mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 17:24:50 -04:00
Fall back on planting icon when plant part icon does not exist
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user