Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request Growstuff#737 from soborok/issue-610-solved
Browse files Browse the repository at this point in the history
resolved issue-610 to display only active planting
  • Loading branch information
Skud committed May 20, 2015
2 parents a3b9c50 + 76608a9 commit aef4800
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/gardens/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
None
- else
%ul
- garden.plantings.each do |p|
- garden.plantings.current.each do |p|
%li
= p.quantity
= link_to p.crop.name, p
Expand Down
8 changes: 7 additions & 1 deletion spec/features/gardens_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
feature "Planting a crop", :js => true do
let!(:garden) { FactoryGirl.create(:garden) }
let!(:planting) { FactoryGirl.create(:planting, garden: garden, planted_at: Date.parse("2013-3-10")) }

let!(:tomato) { FactoryGirl.create(:tomato) }
let!(:finished_planting) { FactoryGirl.create(:finished_planting, garden: garden, crop: tomato) }

background do
login_as(garden.owner)
Expand Down Expand Up @@ -72,4 +73,9 @@
it_behaves_like "append date"
end

scenario "List only active plantings on a garden" do
visit gardens_path
expect(page).not_to have_content finished_planting.crop_name
end

end

0 comments on commit aef4800

Please sign in to comment.