From b8ea6116d42efc19f61a3e98182dc46cc9f52ef7 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 29 Mar 2017 10:46:15 +1300 Subject: [PATCH] Add photos to plantings to make them interesting in the spec --- spec/models/planting_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/models/planting_spec.rb b/spec/models/planting_spec.rb index e2fcda318..8fe9d82c5 100644 --- a/spec/models/planting_spec.rb +++ b/spec/models/planting_spec.rb @@ -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