diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index fda3a9c80..753a42171 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -92,7 +92,8 @@ module IconsHelper end def plant_part_icon(name) - image_icon "plant_parts/#{name}" + image_icon "plant_parts/#{name}" if Files.exists? Rails.root.join('app', 'assets', 'images', 'icons', "{name}.svg") + planting_icon end def crop_icon(crop) diff --git a/spec/features/harvests/harvesting_a_crop_spec.rb b/spec/features/harvests/harvesting_a_crop_spec.rb index 9d4daa5c5..1e83c1a48 100644 --- a/spec/features/harvests/harvesting_a_crop_spec.rb +++ b/spec/features/harvests/harvesting_a_crop_spec.rb @@ -54,7 +54,7 @@ describe "Harvesting a crop", :js, :search do describe "Harvesting from crop page" do before do visit crop_path(maize) - click_link 'Record harvest' + click_link id: 'modalHarvestButton' click_link plant_part.name end @@ -66,7 +66,7 @@ describe "Harvesting a crop", :js, :search do let!(:planting) { create :planting, crop: maize, owner: member, garden: member.gardens.first } before do visit planting_path(planting) - click_link "Record harvest" + click_link id: 'modalHarvestButton' click_link plant_part.name end