From 57f7d489ff0d245c076203253a2ab5bd224a238b Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 18 Oct 2013 17:29:55 +1100 Subject: [PATCH] Rename OpenFoodWeb namespace to OpenFoodNetwork --- app/controllers/admin/order_cycles_controller.rb | 4 ++-- app/controllers/open_food_network/cart_controller.rb | 2 +- .../spree/admin/reports_controller_decorator.rb | 12 ++++++------ app/controllers/spree/home_controller_decorator.rb | 2 +- app/controllers/spree/orders_controller_decorator.rb | 2 +- .../spree/products_controller_decorator.rb | 2 +- app/controllers/spree/taxons_controller_decorator.rb | 2 +- app/helpers/order_cycles_helper.rb | 2 +- app/helpers/spree/base_helper_decorator.rb | 4 ++-- app/models/open_food_network/calculator/weight.rb | 2 +- app/models/spree/order_decorator.rb | 2 +- app/views/spree/shared/_multi_cart.html.haml | 2 +- config/application.rb | 4 ++-- config/initializers/spree.rb | 2 +- .../eaterprises_feature/lib/eaterprises_feature.rb | 2 +- .../lib/eaterprises_feature/engine.rb | 2 +- ...enterprises_distributor_info_rich_text_feature.rb | 2 +- .../engine.rb | 2 +- .../lib/local_organics_feature.rb | 2 +- .../lib/local_organics_feature/engine.rb | 2 +- lib/open_food_network/feature_toggle.rb | 2 +- lib/open_food_network/group_buy_report.rb | 2 +- .../model_class_from_controller_name.rb | 2 +- .../order_and_distributor_report.rb | 2 +- lib/open_food_network/order_cycle_form_applicator.rb | 2 +- lib/open_food_network/order_grouper.rb | 2 +- lib/open_food_network/searcher.rb | 4 ++-- .../split_products_by_distribution.rb | 4 ++-- spec/controllers/cart_controller_spec.rb | 2 +- spec/factories.rb | 2 +- ...prises_distributor_info_rich_text_feature_spec.rb | 2 +- spec/lib/open_food_network/feature_toggle_spec.rb | 2 +- spec/lib/open_food_network/group_buy_report_spec.rb | 6 +++--- .../order_and_distributor_report_spec.rb | 2 +- .../order_cycle_form_applicator_spec.rb | 2 +- spec/lib/open_food_network/order_grouper_spec.rb | 2 +- spec/lib/open_food_network/searcher_spec.rb | 2 +- .../split_products_by_distribution_spec.rb | 4 ++-- spec/models/calculator/weight_spec.rb | 2 +- spec/spec_helper.rb | 2 +- spec/support/feature_toggle_helper.rb | 6 +++--- 41 files changed, 56 insertions(+), 56 deletions(-) diff --git a/app/controllers/admin/order_cycles_controller.rb b/app/controllers/admin/order_cycles_controller.rb index 18ec545de2..c7eda1ddbd 100644 --- a/app/controllers/admin/order_cycles_controller.rb +++ b/app/controllers/admin/order_cycles_controller.rb @@ -23,7 +23,7 @@ module Admin respond_to do |format| if @order_cycle.save - OpenFoodWeb::OrderCycleFormApplicator.new(@order_cycle).go! + OpenFoodNetwork::OrderCycleFormApplicator.new(@order_cycle).go! flash[:notice] = 'Your order cycle has been created.' format.html { redirect_to admin_order_cycles_path } @@ -40,7 +40,7 @@ module Admin respond_to do |format| if @order_cycle.update_attributes(params[:order_cycle]) - OpenFoodWeb::OrderCycleFormApplicator.new(@order_cycle).go! + OpenFoodNetwork::OrderCycleFormApplicator.new(@order_cycle).go! flash[:notice] = 'Your order cycle has been updated.' format.html { redirect_to admin_order_cycles_path } diff --git a/app/controllers/open_food_network/cart_controller.rb b/app/controllers/open_food_network/cart_controller.rb index d93905fd57..38489ce849 100644 --- a/app/controllers/open_food_network/cart_controller.rb +++ b/app/controllers/open_food_network/cart_controller.rb @@ -1,4 +1,4 @@ -module OpenFoodWeb +module OpenFoodNetwork class CartController < ApplicationController respond_to :json diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index a53d1fe80a..98a48c2415 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -5,7 +5,7 @@ require 'open_food_web/order_grouper' require 'open_food_web/model_class_from_controller_name' Spree::Admin::ReportsController.class_eval do - include OpenFoodWeb::ModelClassFromControllerName + include OpenFoodNetwork::ModelClassFromControllerName # Render a partial for orders and fulfillment description respond_override :index => { :html => { :success => lambda { @@ -45,7 +45,7 @@ Spree::Admin::ReportsController.class_eval do @search = Spree::Order.complete.not_state(:canceled).managed_by(spree_current_user).search(params[:q]) orders = @search.result - @report = OpenFoodWeb::OrderAndDistributorReport.new orders + @report = OpenFoodNetwork::OrderAndDistributorReport.new orders unless params[:csv] render :html => @report else @@ -77,7 +77,7 @@ Spree::Admin::ReportsController.class_eval do @distributors = Enterprise.is_distributor.managed_by(spree_current_user) - @report = OpenFoodWeb::GroupBuyReport.new orders + @report = OpenFoodNetwork::GroupBuyReport.new orders unless params[:csv] render :html => @report else @@ -233,7 +233,7 @@ Spree::Admin::ReportsController.class_eval do end - order_grouper = OpenFoodWeb::OrderGrouper.new rules, columns + order_grouper = OpenFoodNetwork::OrderGrouper.new rules, columns @header = header @table = order_grouper.table(@line_items) @@ -337,7 +337,7 @@ Spree::Admin::ReportsController.class_eval do end - order_grouper = OpenFoodWeb::OrderGrouper.new rules, columns + order_grouper = OpenFoodNetwork::OrderGrouper.new rules, columns @header = header @table = order_grouper.table(table_items) @@ -549,7 +549,7 @@ Spree::Admin::ReportsController.class_eval do end - order_grouper = OpenFoodWeb::OrderGrouper.new rules, columns + order_grouper = OpenFoodNetwork::OrderGrouper.new rules, columns @header = header @table = order_grouper.table(table_items) diff --git a/app/controllers/spree/home_controller_decorator.rb b/app/controllers/spree/home_controller_decorator.rb index 73a5285a42..aea423657e 100644 --- a/app/controllers/spree/home_controller_decorator.rb +++ b/app/controllers/spree/home_controller_decorator.rb @@ -3,7 +3,7 @@ require 'open_food_web/split_products_by_distribution' Spree::HomeController.class_eval do include EnterprisesHelper include OrderCyclesHelper - include OpenFoodWeb::SplitProductsByDistribution + include OpenFoodNetwork::SplitProductsByDistribution respond_override :index => { :html => { :success => lambda { @products, @products_local, @products_remote = split_products_by_distribution @products, current_distributor, current_order_cycle diff --git a/app/controllers/spree/orders_controller_decorator.rb b/app/controllers/spree/orders_controller_decorator.rb index 644b01f3b8..f13a21fb47 100644 --- a/app/controllers/spree/orders_controller_decorator.rb +++ b/app/controllers/spree/orders_controller_decorator.rb @@ -6,7 +6,7 @@ Spree::OrdersController.class_eval do # Patch Orders#populate to provide distributor_id and order_cycle_id to OrderPopulator def populate - if OpenFoodWeb::FeatureToggle.enabled? :multi_cart + if OpenFoodNetwork::FeatureToggle.enabled? :multi_cart populate_cart params.slice(:products, :variants, :quantity, :distributor_id, :order_cycle_id) end diff --git a/app/controllers/spree/products_controller_decorator.rb b/app/controllers/spree/products_controller_decorator.rb index 87b3a4834f..d684e44679 100644 --- a/app/controllers/spree/products_controller_decorator.rb +++ b/app/controllers/spree/products_controller_decorator.rb @@ -3,7 +3,7 @@ require 'open_food_web/split_products_by_distribution' Spree::ProductsController.class_eval do include EnterprisesHelper include OrderCyclesHelper - include OpenFoodWeb::SplitProductsByDistribution + include OpenFoodNetwork::SplitProductsByDistribution before_filter :require_distributor_chosen, only: :index diff --git a/app/controllers/spree/taxons_controller_decorator.rb b/app/controllers/spree/taxons_controller_decorator.rb index fc7a22915a..4d796bed6a 100644 --- a/app/controllers/spree/taxons_controller_decorator.rb +++ b/app/controllers/spree/taxons_controller_decorator.rb @@ -3,7 +3,7 @@ require 'open_food_web/split_products_by_distribution' Spree::TaxonsController.class_eval do include EnterprisesHelper include OrderCyclesHelper - include OpenFoodWeb::SplitProductsByDistribution + include OpenFoodNetwork::SplitProductsByDistribution before_filter :require_distributor_chosen, only: :show diff --git a/app/helpers/order_cycles_helper.rb b/app/helpers/order_cycles_helper.rb index 3363e62bf3..995d316f46 100644 --- a/app/helpers/order_cycles_helper.rb +++ b/app/helpers/order_cycles_helper.rb @@ -39,7 +39,7 @@ module OrderCyclesHelper def order_cycles_enabled? - OpenFoodWeb::FeatureToggle.enabled? :order_cycles + OpenFoodNetwork::FeatureToggle.enabled? :order_cycles end end diff --git a/app/helpers/spree/base_helper_decorator.rb b/app/helpers/spree/base_helper_decorator.rb index 2f87015d42..8da5adaeb1 100644 --- a/app/helpers/spree/base_helper_decorator.rb +++ b/app/helpers/spree/base_helper_decorator.rb @@ -7,8 +7,8 @@ module Spree css_class = (current_taxon && current_taxon.self_and_ancestors.include?(taxon)) ? 'current' : nil # The concern of separating products by distributor and order cycle is dealt with in - # a few other places: OpenFoodWeb::Searcher (for searching over products) and in - # OpenFoodWeb::SplitProductsByDistribution (for splitting the main product display). + # a few other places: OpenFoodNetwork::Searcher (for searching over products) and in + # OpenFoodNetwork::SplitProductsByDistribution (for splitting the main product display). products = Product.in_taxon(taxon) products = products.in_distributor(current_distributor) if current_distributor diff --git a/app/models/open_food_network/calculator/weight.rb b/app/models/open_food_network/calculator/weight.rb index 049f4ad15f..7cd44eb7f7 100644 --- a/app/models/open_food_network/calculator/weight.rb +++ b/app/models/open_food_network/calculator/weight.rb @@ -1,4 +1,4 @@ -module OpenFoodWeb +module OpenFoodNetwork class Calculator::Weight < Spree::Calculator preference :per_kg, :decimal, :default => 0.0 attr_accessible :preferred_per_kg diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index b33e44231d..7c6effc7bf 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -50,7 +50,7 @@ Spree::Order.class_eval do # -- Methods def products_available_from_new_distribution # Check that the line_items in the current order are available from a newly selected distribution - if OpenFoodWeb::FeatureToggle.enabled? :order_cycles + if OpenFoodNetwork::FeatureToggle.enabled? :order_cycles errors.add(:base, "Distributor or order cycle cannot supply the products in your cart") unless DistributionChangeValidator.new(self).can_change_to_distribution?(distributor, order_cycle) else errors.add(:distributor_id, "cannot supply the products in your cart") unless DistributionChangeValidator.new(self).can_change_to_distributor?(distributor) diff --git a/app/views/spree/shared/_multi_cart.html.haml b/app/views/spree/shared/_multi_cart.html.haml index 346ec729f0..a249b21a78 100644 --- a/app/views/spree/shared/_multi_cart.html.haml +++ b/app/views/spree/shared/_multi_cart.html.haml @@ -1,3 +1,3 @@ -- if OpenFoodWeb::FeatureToggle.enabled? :multi_cart +- if OpenFoodNetwork::FeatureToggle.enabled? :multi_cart = render :partial => 'open_food_web/cart/show' \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index 5b8e2db1ac..93317e246f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -26,14 +26,14 @@ module Openfoodweb # Register Spree calculators initializer "spree.register.calculators" do |app| - app.config.spree.calculators.shipping_methods << OpenFoodWeb::Calculator::Weight + app.config.spree.calculators.shipping_methods << OpenFoodNetwork::Calculator::Weight app.config.spree.calculators.enterprise_fees = [Spree::Calculator::FlatPercentItemTotal, Spree::Calculator::FlatRate, Spree::Calculator::FlexiRate, Spree::Calculator::PerItem, Spree::Calculator::PriceSack, - OpenFoodWeb::Calculator::Weight] + OpenFoodNetwork::Calculator::Weight] end # Register Spree payment methods diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb index 6ede1f6893..f18e28347c 100644 --- a/config/initializers/spree.rb +++ b/config/initializers/spree.rb @@ -14,7 +14,7 @@ Spree.config do |config| config.shipping_instructions = true config.checkout_zone = 'Australia' config.address_requires_state = true - config.searcher_class = OpenFoodWeb::Searcher + config.searcher_class = OpenFoodNetwork::Searcher # 109 should be Australia. Hardcoded for CI (Jenkins), where countries are not pre-loaded. config.default_country_id = Spree::Country.find_by_name('Australia').andand.id || 109 diff --git a/lib/chili/eaterprises_feature/lib/eaterprises_feature.rb b/lib/chili/eaterprises_feature/lib/eaterprises_feature.rb index 85721e6d81..72cd9d7d95 100644 --- a/lib/chili/eaterprises_feature/lib/eaterprises_feature.rb +++ b/lib/chili/eaterprises_feature/lib/eaterprises_feature.rb @@ -3,5 +3,5 @@ require "eaterprises_feature/engine" module EaterprisesFeature extend Chili::Base - active_if { OpenFoodWeb::FeatureToggle.enabled? :eaterprises } + active_if { OpenFoodNetwork::FeatureToggle.enabled? :eaterprises } end diff --git a/lib/chili/eaterprises_feature/lib/eaterprises_feature/engine.rb b/lib/chili/eaterprises_feature/lib/eaterprises_feature/engine.rb index f9ac4c8ab7..d92cf11ef9 100644 --- a/lib/chili/eaterprises_feature/lib/eaterprises_feature/engine.rb +++ b/lib/chili/eaterprises_feature/lib/eaterprises_feature/engine.rb @@ -4,7 +4,7 @@ module EaterprisesFeature class Engine < ::Rails::Engine isolate_namespace EaterprisesFeature - if OpenFoodWeb::FeatureToggle.enabled? :eaterprises + if OpenFoodNetwork::FeatureToggle.enabled? :eaterprises initializer 'eaterprises_feature.sass', :after => :load_config_initializers do |app| app.config.sass.load_paths += [self.root.join('app', 'assets', 'stylesheets', 'eaterprises_feature')] if Rails.application.config.respond_to? :sass end diff --git a/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature.rb b/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature.rb index ff3f18bd50..c8cc1e8333 100644 --- a/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature.rb +++ b/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature.rb @@ -3,5 +3,5 @@ require "enterprises_distributor_info_rich_text_feature/engine" module EnterprisesDistributorInfoRichTextFeature extend Chili::Base - active_if { OpenFoodWeb::FeatureToggle.enabled? :enterprises_distributor_info_rich_text } + active_if { OpenFoodNetwork::FeatureToggle.enabled? :enterprises_distributor_info_rich_text } end diff --git a/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature/engine.rb b/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature/engine.rb index 538c64e30e..a721a13eaa 100644 --- a/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature/engine.rb +++ b/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature/engine.rb @@ -5,7 +5,7 @@ module EnterprisesDistributorInfoRichTextFeature isolate_namespace EnterprisesDistributorInfoRichTextFeature initializer 'enterprises_distributor_info_rich_text_feature.mailer', :after => :load_config_initializers do |app| - if OpenFoodWeb::FeatureToggle.enabled? :enterprises_distributor_info_rich_text + if OpenFoodNetwork::FeatureToggle.enabled? :enterprises_distributor_info_rich_text ::Spree::OrderMailer.class_eval do helper CheckoutHelper diff --git a/lib/chili/local_organics_feature/lib/local_organics_feature.rb b/lib/chili/local_organics_feature/lib/local_organics_feature.rb index cf69d371ee..148abe7761 100644 --- a/lib/chili/local_organics_feature/lib/local_organics_feature.rb +++ b/lib/chili/local_organics_feature/lib/local_organics_feature.rb @@ -3,5 +3,5 @@ require "local_organics_feature/engine" module LocalOrganicsFeature extend Chili::Base - active_if { OpenFoodWeb::FeatureToggle.enabled? :local_organics } + active_if { OpenFoodNetwork::FeatureToggle.enabled? :local_organics } end diff --git a/lib/chili/local_organics_feature/lib/local_organics_feature/engine.rb b/lib/chili/local_organics_feature/lib/local_organics_feature/engine.rb index 643cb17b2d..bbe3be421e 100644 --- a/lib/chili/local_organics_feature/lib/local_organics_feature/engine.rb +++ b/lib/chili/local_organics_feature/lib/local_organics_feature/engine.rb @@ -4,7 +4,7 @@ module LocalOrganicsFeature class Engine < ::Rails::Engine isolate_namespace LocalOrganicsFeature - if OpenFoodWeb::FeatureToggle.enabled? :local_organics + if OpenFoodNetwork::FeatureToggle.enabled? :local_organics initializer 'local_organics_feature.sass', :after => :load_config_initializers do |app| app.config.sass.load_paths += [self.root.join('app', 'assets', 'stylesheets', 'local_organics_feature')] if Rails.application.config.respond_to? :sass end diff --git a/lib/open_food_network/feature_toggle.rb b/lib/open_food_network/feature_toggle.rb index 00834da4e0..e7c5785850 100644 --- a/lib/open_food_network/feature_toggle.rb +++ b/lib/open_food_network/feature_toggle.rb @@ -1,4 +1,4 @@ -module OpenFoodWeb +module OpenFoodNetwork class FeatureToggle def self.enabled? feature features[feature] diff --git a/lib/open_food_network/group_buy_report.rb b/lib/open_food_network/group_buy_report.rb index 3234d1078c..b4875b49a5 100644 --- a/lib/open_food_network/group_buy_report.rb +++ b/lib/open_food_network/group_buy_report.rb @@ -1,4 +1,4 @@ -module OpenFoodWeb +module OpenFoodNetwork GroupBuyVariantRow = Struct.new(:variant, :sum_quantities, :sum_max_quantities) do def to_row diff --git a/lib/open_food_network/model_class_from_controller_name.rb b/lib/open_food_network/model_class_from_controller_name.rb index deac2ee078..6c6a8147e8 100644 --- a/lib/open_food_network/model_class_from_controller_name.rb +++ b/lib/open_food_network/model_class_from_controller_name.rb @@ -1,4 +1,4 @@ -module OpenFoodWeb +module OpenFoodNetwork module ModelClassFromControllerName # Equivalent to CanCan's "authorize_resource :class => false" (see https://github.com/ryanb/cancan/blob/master/lib/cancan/controller_resource.rb#L146) def model_class diff --git a/lib/open_food_network/order_and_distributor_report.rb b/lib/open_food_network/order_and_distributor_report.rb index 6d9556cef7..2662b176dd 100644 --- a/lib/open_food_network/order_and_distributor_report.rb +++ b/lib/open_food_network/order_and_distributor_report.rb @@ -1,5 +1,5 @@ -module OpenFoodWeb +module OpenFoodNetwork class OrderAndDistributorReport def initialize orders diff --git a/lib/open_food_network/order_cycle_form_applicator.rb b/lib/open_food_network/order_cycle_form_applicator.rb index 6ea5b5f174..33eadcdc51 100644 --- a/lib/open_food_network/order_cycle_form_applicator.rb +++ b/lib/open_food_network/order_cycle_form_applicator.rb @@ -1,4 +1,4 @@ -module OpenFoodWeb +module OpenFoodNetwork # There are two translator classes on the boundary between Angular and Rails: On the Angular side, # there is the OrderCycle#dataForSubmit method, and on the Rails side is this class. I think data diff --git a/lib/open_food_network/order_grouper.rb b/lib/open_food_network/order_grouper.rb index d222a7cc13..c0a0fc51ea 100644 --- a/lib/open_food_network/order_grouper.rb +++ b/lib/open_food_network/order_grouper.rb @@ -1,4 +1,4 @@ -module OpenFoodWeb +module OpenFoodNetwork class OrderGrouper def initialize(rules, column_constructors) diff --git a/lib/open_food_network/searcher.rb b/lib/open_food_network/searcher.rb index 8aba847373..83781ea475 100644 --- a/lib/open_food_network/searcher.rb +++ b/lib/open_food_network/searcher.rb @@ -1,6 +1,6 @@ require 'spree/core/search/base' -module OpenFoodWeb +module OpenFoodNetwork class Searcher < Spree::Core::Search::Base # Do not perform pagination @@ -15,7 +15,7 @@ module OpenFoodWeb base_scope = super # The concern of separating products by distributor and order cycle is dealt with in - # a few other places: OpenFoodWeb::SplitProductsByDistribution (for splitting the main + # a few other places: OpenFoodNetwork::SplitProductsByDistribution (for splitting the main # product display) and Spree::BaseHelper decorator (for taxon counts). base_scope = base_scope.in_supplier_or_distributor(enterprise_id) if enterprise_id diff --git a/lib/open_food_network/split_products_by_distribution.rb b/lib/open_food_network/split_products_by_distribution.rb index ebbaa36c7d..637c91b3d4 100644 --- a/lib/open_food_network/split_products_by_distribution.rb +++ b/lib/open_food_network/split_products_by_distribution.rb @@ -1,7 +1,7 @@ -module OpenFoodWeb +module OpenFoodNetwork # The concern of separating products by distributor and order cycle is dealt with in a few - # other places: OpenFoodWeb::Searcher (for searching over products) and in + # other places: OpenFoodNetwork::Searcher (for searching over products) and in # Spree::BaseHelper decorator (for taxon counts). module SplitProductsByDistribution diff --git a/spec/controllers/cart_controller_spec.rb b/spec/controllers/cart_controller_spec.rb index f9c6f2a5bc..5715b50987 100644 --- a/spec/controllers/cart_controller_spec.rb +++ b/spec/controllers/cart_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'spree/api/testing_support/helpers' -module OpenFoodWeb +module OpenFoodNetwork describe CartController do render_views diff --git a/spec/factories.rb b/spec/factories.rb index 1c27a8c916..15cbb56553 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -122,7 +122,7 @@ FactoryGirl.define do enterprise_role 'distributor' end - factory :weight_calculator, :class => OpenFoodWeb::Calculator::Weight do + factory :weight_calculator, :class => OpenFoodNetwork::Calculator::Weight do after(:build) { |c| c.set_preference(:per_kg, 0.5) } after(:create) { |c| c.set_preference(:per_kg, 0.5); c.save! } end diff --git a/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb b/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb index 9c51cc9eb5..acf32dbcf5 100644 --- a/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb +++ b/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb @@ -5,7 +5,7 @@ feature "enterprises distributor info as rich text" do include WebHelper before(:each) do - OpenFoodWeb::FeatureToggle.stub(:features).and_return({eaterprises: false, + OpenFoodNetwork::FeatureToggle.stub(:features).and_return({eaterprises: false, local_organics: true, enterprises_distributor_info_rich_text: true}) diff --git a/spec/lib/open_food_network/feature_toggle_spec.rb b/spec/lib/open_food_network/feature_toggle_spec.rb index 7487a97d55..b66a88208f 100644 --- a/spec/lib/open_food_network/feature_toggle_spec.rb +++ b/spec/lib/open_food_network/feature_toggle_spec.rb @@ -1,6 +1,6 @@ require 'open_food_web/feature_toggle' -module OpenFoodWeb +module OpenFoodNetwork describe FeatureToggle do it "returns true when feature is on" do FeatureToggle.stub(:features).and_return({foo: true}) diff --git a/spec/lib/open_food_network/group_buy_report_spec.rb b/spec/lib/open_food_network/group_buy_report_spec.rb index 23bfc70957..252c352c31 100644 --- a/spec/lib/open_food_network/group_buy_report_spec.rb +++ b/spec/lib/open_food_network/group_buy_report_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -module OpenFoodWeb +module OpenFoodNetwork describe GroupBuyReport do before(:each) do @@ -81,8 +81,8 @@ module OpenFoodWeb table_row_objects = subject.variants_and_quantities - variant_rows = table_row_objects.select { |r| r.class == OpenFoodWeb::GroupBuyVariantRow } - product_rows = table_row_objects.select { |r| r.class == OpenFoodWeb::GroupBuyProductRow } + variant_rows = table_row_objects.select { |r| r.class == OpenFoodNetwork::GroupBuyVariantRow } + product_rows = table_row_objects.select { |r| r.class == OpenFoodNetwork::GroupBuyProductRow } supplier_groups = variant_rows.group_by { |r| r.variant.product.supplier } variant_groups = variant_rows.group_by { |r| r.variant } diff --git a/spec/lib/open_food_network/order_and_distributor_report_spec.rb b/spec/lib/open_food_network/order_and_distributor_report_spec.rb index 69397c1494..e2f693d03c 100644 --- a/spec/lib/open_food_network/order_and_distributor_report_spec.rb +++ b/spec/lib/open_food_network/order_and_distributor_report_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -module OpenFoodWeb +module OpenFoodNetwork describe OrderAndDistributorReport do describe "orders and distributors report" do diff --git a/spec/lib/open_food_network/order_cycle_form_applicator_spec.rb b/spec/lib/open_food_network/order_cycle_form_applicator_spec.rb index d5bf56b34c..98fc840ea2 100644 --- a/spec/lib/open_food_network/order_cycle_form_applicator_spec.rb +++ b/spec/lib/open_food_network/order_cycle_form_applicator_spec.rb @@ -1,6 +1,6 @@ require 'open_food_web/order_cycle_form_applicator' -module OpenFoodWeb +module OpenFoodNetwork describe OrderCycleFormApplicator do context "unit specs" do it "creates new exchanges for incoming_exchanges" do diff --git a/spec/lib/open_food_network/order_grouper_spec.rb b/spec/lib/open_food_network/order_grouper_spec.rb index d734b78c7b..6982db2988 100644 --- a/spec/lib/open_food_network/order_grouper_spec.rb +++ b/spec/lib/open_food_network/order_grouper_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -module OpenFoodWeb +module OpenFoodNetwork describe OrderGrouper do before(:each) do diff --git a/spec/lib/open_food_network/searcher_spec.rb b/spec/lib/open_food_network/searcher_spec.rb index 5c18b51f15..91a66c4a30 100644 --- a/spec/lib/open_food_network/searcher_spec.rb +++ b/spec/lib/open_food_network/searcher_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'open_food_web/searcher' -module OpenFoodWeb +module OpenFoodNetwork describe Searcher do it "searches by supplier" do # Given products under two suppliers diff --git a/spec/lib/open_food_network/split_products_by_distribution_spec.rb b/spec/lib/open_food_network/split_products_by_distribution_spec.rb index 678f94c327..97c847c5f3 100644 --- a/spec/lib/open_food_network/split_products_by_distribution_spec.rb +++ b/spec/lib/open_food_network/split_products_by_distribution_spec.rb @@ -1,7 +1,7 @@ require 'open_food_web/split_products_by_distribution' -describe OpenFoodWeb::SplitProductsByDistribution do - let(:products_splitter) { Class.new { include OpenFoodWeb::SplitProductsByDistribution } } +describe OpenFoodNetwork::SplitProductsByDistribution do + let(:products_splitter) { Class.new { include OpenFoodNetwork::SplitProductsByDistribution } } let(:subject) { products_splitter.new } diff --git a/spec/models/calculator/weight_spec.rb b/spec/models/calculator/weight_spec.rb index 3b71a0787b..26ec3125a5 100644 --- a/spec/models/calculator/weight_spec.rb +++ b/spec/models/calculator/weight_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe OpenFoodWeb::Calculator::Weight do +describe OpenFoodNetwork::Calculator::Weight do it "computes shipping cost for an order by total weight" do variant_1 = double(:variant, :weight => 10) variant_2 = double(:variant, :weight => 20) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index beee83f4e4..3edbba9ea6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -87,7 +87,7 @@ RSpec.configure do |config| config.include Spree::CheckoutHelpers config.include Spree::Core::TestingSupport::ControllerRequests, :type => :controller config.include Devise::TestHelpers, :type => :controller - config.include OpenFoodWeb::FeatureToggleHelper + config.include OpenFoodNetwork::FeatureToggleHelper config.include ActionView::Helpers::DateHelper # Factory girl diff --git a/spec/support/feature_toggle_helper.rb b/spec/support/feature_toggle_helper.rb index 054bd9fead..7471103e4f 100644 --- a/spec/support/feature_toggle_helper.rb +++ b/spec/support/feature_toggle_helper.rb @@ -1,9 +1,9 @@ -module OpenFoodWeb +module OpenFoodNetwork module FeatureToggleHelper def set_feature_toggle(feature, status) - features = OpenFoodWeb::FeatureToggle.features + features = OpenFoodNetwork::FeatureToggle.features features[feature] = status - OpenFoodWeb::FeatureToggle.stub(:features) { features } + OpenFoodNetwork::FeatureToggle.stub(:features) { features } end end end