diff --git a/spec/features/admin/enterprise_fees_spec.rb b/spec/features/admin/enterprise_fees_spec.rb index 7025b54766..cd24e8e3a3 100644 --- a/spec/features/admin/enterprise_fees_spec.rb +++ b/spec/features/admin/enterprise_fees_spec.rb @@ -77,13 +77,13 @@ feature %q{ page.should have_select "enterprise_fee_set_collection_attributes_0_fee_type", selected: 'Admin' page.should have_selector "input[value='Greetings!']" page.should have_select 'enterprise_fee_set_collection_attributes_0_tax_category_id', selected: 'Inherit From Product' - page.should have_selector "option[selected]", text: 'Flat Percent' + page.should have_selector "option[selected]", text: 'Flat Percent (per item)' fee.reload fee.enterprise.should == enterprise fee.name.should == 'Greetings!' fee.fee_type.should == 'admin' - fee.calculator_type.should == "Spree::Calculator::FlatPercentItemTotal" + fee.calculator_type.should == "Calculator::FlatPercentPerItem" # Sets tax_category and inherits_tax_category fee.tax_category.should == nil diff --git a/spec/features/consumer/shopping/variant_overrides_spec.rb b/spec/features/consumer/shopping/variant_overrides_spec.rb index e6be127791..f4ee8e6275 100644 --- a/spec/features/consumer/shopping/variant_overrides_spec.rb +++ b/spec/features/consumer/shopping/variant_overrides_spec.rb @@ -28,7 +28,7 @@ feature "shopping with variant overrides defined", js: true, retry: 3 do let!(:vo4) { create(:variant_override, hub: hub, variant: v4, count_on_hand: 3, default_stock: nil, resettable: false) } let!(:vo5) { create(:variant_override, hub: hub, variant: v5, count_on_hand: 0, default_stock: nil, resettable: false) } let!(:vo6) { create(:variant_override, hub: hub, variant: v6, count_on_hand: 6, default_stock: nil, resettable: false) } - let(:ef) { create(:enterprise_fee, enterprise: hub, fee_type: 'packing', calculator: Spree::Calculator::FlatPercentItemTotal.new(preferred_flat_percent: 10)) } + let(:ef) { create(:enterprise_fee, enterprise: hub, fee_type: 'packing', calculator: Calculator::FlatPercentPerItem.new(preferred_flat_percent: 10)) } before do outgoing_exchange.variants = [v1, v2, v3, v4, v5, v6] diff --git a/spec/lib/open_food_network/enterprise_fee_calculator_spec.rb b/spec/lib/open_food_network/enterprise_fee_calculator_spec.rb index a31295ac9d..0fb42f3052 100644 --- a/spec/lib/open_food_network/enterprise_fee_calculator_spec.rb +++ b/spec/lib/open_food_network/enterprise_fee_calculator_spec.rb @@ -66,7 +66,7 @@ module OpenFoodNetwork end describe "summing percentage fees for the variant" do - let!(:enterprise_fee1) { create(:enterprise_fee, amount: 20, fee_type: "admin", calculator: Spree::Calculator::FlatPercentItemTotal.new(preferred_flat_percent: 20)) } + let!(:enterprise_fee1) { create(:enterprise_fee, amount: 20, fee_type: "admin", calculator: ::Calculator::FlatPercentPerItem.new(preferred_flat_percent: 20)) } let!(:exchange) { create(:exchange, order_cycle: order_cycle, sender: coordinator, receiver: distributor, incoming: false, enterprise_fees: [enterprise_fee1], variants: [product1.master]) } diff --git a/spec/models/enterprise_fee_spec.rb b/spec/models/enterprise_fee_spec.rb index 7fac566f4b..e0df4ce5d0 100644 --- a/spec/models/enterprise_fee_spec.rb +++ b/spec/models/enterprise_fee_spec.rb @@ -75,7 +75,7 @@ describe EnterpriseFee do it "returns fees with any other calculator" do ef1 = create(:enterprise_fee, calculator: Spree::Calculator::DefaultTax.new) - ef2 = create(:enterprise_fee, calculator: Spree::Calculator::FlatPercentItemTotal.new) + ef2 = create(:enterprise_fee, calculator: Calculator::FlatPercentPerItem.new) ef3 = create(:enterprise_fee, calculator: Spree::Calculator::PerItem.new) ef4 = create(:enterprise_fee, calculator: Spree::Calculator::PriceSack.new) @@ -93,7 +93,7 @@ describe EnterpriseFee do it "does not return fees with any other calculator" do ef1 = create(:enterprise_fee, calculator: Spree::Calculator::DefaultTax.new) - ef2 = create(:enterprise_fee, calculator: Spree::Calculator::FlatPercentItemTotal.new) + ef2 = create(:enterprise_fee, calculator: Calculator::FlatPercentPerItem.new) ef3 = create(:enterprise_fee, calculator: Spree::Calculator::PerItem.new) ef4 = create(:enterprise_fee, calculator: Spree::Calculator::PriceSack.new)