Add photos to plantings to make them interesting in the spec

This commit is contained in:
Brenda Wallace
2017-03-29 10:46:15 +13:00
parent 2521e52d71
commit b8ea6116d4

View File

@@ -265,6 +265,9 @@ describe Planting do
context "with howmany argument" do
it "only returns the number asked for" do
@plantings = FactoryGirl.create_list(:planting, 10)
@plantings.each do |p|
p.photos << FactoryGirl.create(:photo, owner: planting.owner)
end
Planting.interesting.limit(3).count.should eq 3
end
end