Add crop name to actions

This commit is contained in:
Brenda Wallace
2019-01-23 16:19:08 +13:00
parent 9bb08e9dac
commit 045deb1ae4
2 changed files with 5 additions and 3 deletions

View File

@@ -31,6 +31,6 @@
days after planting
- if can? :create, Planting
= link_to 'Plant this', new_planting_path(params: { crop_id: crop.id }), class: 'btn btn-primary'
= link_to "Plant #{crop.name}", new_planting_path(params: { crop_id: crop.id }), class: 'btn btn-primary'
- if can? :create, Seed
= link_to 'Add seeds to stash', new_seed_path(params: { crop_id: crop.id }), class: 'btn btn-primary'
= link_to "Add #{crop.name} seeds to stash", new_seed_path(params: { crop_id: crop.id }), class: 'btn btn-primary'

View File

@@ -64,7 +64,9 @@ feature "Harvesting a crop", :js, :elasticsearch do
scenario "Harvesting from crop page" do
visit crop_path(maize)
click_link "Harvest this"
within '.crop-actions' do
click_link "Harvest #{maize.name}"
end
within "form#new_harvest" do
select plant_part.name, from: 'harvest[plant_part_id]'
expect(page).to have_selector "input[value='maize']"