diff --git a/spec/factories.rb b/spec/factories.rb index 6038f62cea..2ce408807f 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -103,7 +103,7 @@ FactoryGirl.define do sequence(:fee_type) { |n| EnterpriseFee::FEE_TYPES[n % EnterpriseFee::FEE_TYPES.count] } enterprise { Enterprise.first || FactoryGirl.create(:supplier_enterprise) } - calculator { FactoryGirl.build(:calculator, preferred_amount: amount || generate(:calculator_amount)) } + calculator { Spree::Calculator::PerItem.new(preferred_amount: amount || generate(:calculator_amount)) } after(:create) { |ef| ef.calculator.save! } end diff --git a/spec/features/consumer/checkout_spec.rb b/spec/features/consumer/checkout_spec.rb index 9cd7ee1925..e4bb843ad3 100644 --- a/spec/features/consumer/checkout_spec.rb +++ b/spec/features/consumer/checkout_spec.rb @@ -39,11 +39,11 @@ feature %q{ :country => Spree::Country.find_by_name('Australia')), :pickup_times => 'Tuesday, 4 PM') - @enterprise_fee_1 = create(:enterprise_fee, :name => 'Enterprise Fee One', :calculator => Spree::Calculator::FlatRate.new) + @enterprise_fee_1 = create(:enterprise_fee, :name => 'Enterprise Fee One', :calculator => Spree::Calculator::PerItem.new) @enterprise_fee_1.calculator.set_preference :amount, 1 @enterprise_fee_1.calculator.save! - @enterprise_fee_2 = create(:enterprise_fee, :name => 'Enterprise Fee Two', :calculator => Spree::Calculator::FlatRate.new) + @enterprise_fee_2 = create(:enterprise_fee, :name => 'Enterprise Fee Two', :calculator => Spree::Calculator::PerItem.new) @enterprise_fee_2.calculator.set_preference :amount, 2 @enterprise_fee_2.calculator.save! @@ -175,9 +175,9 @@ feature %q{ # Given two distributors and enterprise fees d1 = create(:distributor_enterprise) d2 = create(:distributor_enterprise) - ef1 = create(:enterprise_fee, calculator: Spree::Calculator::FlatRate.new) + ef1 = create(:enterprise_fee, calculator: Spree::Calculator::PerItem.new) ef1.calculator.set_preference :amount, 1.23; ef1.calculator.save! - ef2 = create(:enterprise_fee, calculator: Spree::Calculator::FlatRate.new) + ef2 = create(:enterprise_fee, calculator: Spree::Calculator::PerItem.new) ef2.calculator.set_preference :amount, 2.34; ef2.calculator.save! # And two products both available from both distributors