WIP: Call create_order_adjustments_for on EnterpriseFeeCalculator

This commit is contained in:
Rohan Mitchell
2014-07-31 09:35:21 +10:00
parent 8fe355b6da
commit 45fd479ade
2 changed files with 8 additions and 3 deletions

View File

@@ -142,7 +142,9 @@ Spree::Order.class_eval do
end
end
order_cycle.create_order_adjustments_for self if order_cycle
if order_cycle
OpenFoodNetwork::EnterpriseFeeCalculator.new.create_order_adjustments_for self
end
end
def set_variant_attributes(variant, attributes)

View File

@@ -85,7 +85,7 @@ describe Spree::Order do
OpenFoodNetwork::EnterpriseFeeCalculator.any_instance.
should_receive(:create_line_item_adjustments_for).
with(line_item)
order_cycle.stub(:create_order_adjustments_for)
OpenFoodNetwork::EnterpriseFeeCalculator.any_instance.stub(:create_order_adjustments_for)
subject.stub(:order_cycle) { order_cycle }
subject.update_distribution_charge!
@@ -96,7 +96,10 @@ describe Spree::Order do
subject.stub(:line_items) { [] }
order_cycle = double(:order_cycle)
order_cycle.should_receive(:create_order_adjustments_for).with(subject)
OpenFoodNetwork::EnterpriseFeeCalculator.any_instance.
should_receive(:create_order_adjustments_for).
with(subject)
subject.stub(:order_cycle) { order_cycle }
subject.update_distribution_charge!