Find exchanges with a particular variant

This commit is contained in:
Rohan Mitchell
2013-08-16 15:12:03 +10:00
parent 1d23446c40
commit 9563aad9fa
2 changed files with 9 additions and 0 deletions

View File

@@ -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