Make order cycle specs more robust

This commit is contained in:
Rohan Mitchell
2014-04-03 11:18:46 +11:00
parent 19ca8e142a
commit e792107d7b
2 changed files with 4 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ r.element :order_cycle, @order_cycle do
r.element :id
end
r.list_of :exchanges do |exchange|
r.list_of :exchanges, @order_cycle.exchanges.order('id ASC') do |exchange|
r.element :id
r.element :sender_id
r.element :receiver_id

View File

@@ -141,9 +141,9 @@ feature %q{
page.should have_selector 'td.distributors', text: 'My distributor'
# And it should have some fees
OrderCycle.last.exchanges.first.enterprise_fees.should == [supplier_fee]
OrderCycle.last.coordinator_fees.should == [coordinator_fee]
OrderCycle.last.exchanges.last.enterprise_fees.should == [distributor_fee]
OrderCycle.last.exchanges.incoming.first.enterprise_fees.should == [supplier_fee]
OrderCycle.last.coordinator_fees.should == [coordinator_fee]
OrderCycle.last.exchanges.outgoing.first.enterprise_fees.should == [distributor_fee]
# And it should have some variants selected
OrderCycle.last.exchanges.first.variants.count.should == 2