diff --git a/app/models/concerns/open_farm_data.rb b/app/models/concerns/open_farm_data.rb index d8d12e2e8..64bcee0b5 100644 --- a/app/models/concerns/open_farm_data.rb +++ b/app/models/concerns/open_farm_data.rb @@ -39,10 +39,6 @@ module OpenFarmData fetch_attr('common_names') end - def guides_count - fetch_attr('guides_count') - end - def binomial_name fetch_attr('binomial_name') end diff --git a/app/views/crops/_planting_advice.html.haml b/app/views/crops/_planting_advice.html.haml deleted file mode 100644 index a554a7058..000000000 --- a/app/views/crops/_planting_advice.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -- if crop.guides_count.present? && crop.guides_count.positive? - %p - There are - = link_to "https://openfarm.cc/en/crops/#{CGI.escape @crop.name.gsub(' ', '-').downcase}" do - #{crop.guides_count} growing guides on Open Farm - diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index c4b1685ba..8478b09d4 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -74,7 +74,6 @@ .card-body %h4 How to grow #{@crop.name.pluralize} = render 'grown_for', crop: @crop - = render 'planting_advice', crop: @crop - if @crop.parent %hr/ %p.parent-crop @@ -124,13 +123,6 @@ = icon 'fas', 'external-link-alt' Wikipedia (English) - %li.list-group-item - = link_to "https://openfarm.cc/en/crops/#{CGI.escape @crop.name.gsub(' ', '-')}", - class: 'card-link', - target: "_blank", - rel: "noopener noreferrer" do - = icon 'fas', 'external-link-alt' - OpenFarm - Growing guide %li.list-group-item = link_to "https://www.gardenate.com/plant/#{CGI.escape @crop.name}", target: "_blank", diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index 96020dca7..cc566d2ac 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -76,10 +76,6 @@ describe "crop detail page", :js do expect(page).to have_link "Wikipedia (English)", href: crop.en_wikipedia_url end - it "has a link to OpenFarm" do - expect(page).to have_link "OpenFarm - Growing guide" - end - it "has a link to gardenate" do expect(page).to have_link "Gardenate - Planting reminders", href: "https://www.gardenate.com/plant/#{CGI.escape crop.name}" @@ -144,7 +140,7 @@ describe "crop detail page", :js do let(:crop) { FactoryBot.create(:annual_crop) } describe 'with harvests' do - include_examples "predicts harvest" + it_behaves_like "predicts harvest" end it "predicts lifespan" do @@ -165,7 +161,7 @@ describe "crop detail page", :js do end describe 'with harvests' do - include_examples "predicts harvest" + it_behaves_like "predicts harvest" end it "describes Perennial crops" do @@ -181,7 +177,7 @@ describe "crop detail page", :js do end describe 'with harvests' do - include_examples "predicts harvest" + it_behaves_like "predicts harvest" end end end