From e574185c958da3c96dcbb1f5d70d06cd81a4fa8b Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 29 Nov 2013 14:48:06 +1100 Subject: [PATCH] Fixing an ordering issue in the order cycle spec --- spec/models/order_cycle_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/models/order_cycle_spec.rb b/spec/models/order_cycle_spec.rb index 6f857e8d52..1f3f4a0ad2 100644 --- a/spec/models/order_cycle_spec.rb +++ b/spec/models/order_cycle_spec.rb @@ -280,8 +280,13 @@ describe OrderCycle do occ.coordinator.should == oc.coordinator occ.coordinator_fee_ids.should == oc.coordinator_fee_ids - - (0..occ.exchanges.count).all? { |i| occ.exchanges[i].eql? oc.exchanges[i] }.should be_true + + #(0..occ.exchanges.count).all? { |i| occ.exchanges[i].eql? oc.exchanges[i] }.should be_true + + # to_h gives us a unique hash for each exchange + occ.exchanges.map(&:to_h).all? do |ex| + oc.exchanges.map(&:to_h).include? ex + end end describe "creating adjustments for a line item" do