mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
Find exchanges with a particular variant
This commit is contained in:
@@ -60,5 +60,13 @@ describe Exchange do
|
||||
it "finds outgoing exchanges" do
|
||||
Exchange.outgoing.should == [outgoing_exchange]
|
||||
end
|
||||
|
||||
it "finds exchanges with a particular variant" do
|
||||
v = create(:variant)
|
||||
ex = create(:exchange)
|
||||
ex.variants << v
|
||||
|
||||
Exchange.with_variant(v).should == [ex]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user