On enterprise page, do not display products outside of the outgoing exchange

This commit is contained in:
Rohan Mitchell
2013-11-15 15:08:45 +11:00
parent 59935619e3
commit 7a8bd16083
4 changed files with 56 additions and 7 deletions

View File

@@ -172,9 +172,9 @@ describe OrderCycle do
@e2 = create(:exchange,
order_cycle: @oc, sender: @oc.coordinator, receiver: @d2)
@p0 = create(:product)
@p1 = create(:product)
@p2 = create(:product)
@p0 = create(:simple_product)
@p1 = create(:simple_product)
@p2 = create(:simple_product)
@p2_v = create(:variant, product: @p2)
@e0.variants << @p0.master
@@ -196,6 +196,10 @@ describe OrderCycle do
@oc.variants_distributed_by(@d2).should == [@p1.master]
end
it "reports on the products distributed by a particular distributor" do
@oc.products_distributed_by(@d2).should == [@p1]
end
it "reports on the products exchanged" do
@oc.products.sort.should == [@p0, @p1, @p2]
end