From f55cdcdd344aac5d344fb75bf2e4965fe4c5b181 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 12 Feb 2025 15:01:51 +1100 Subject: [PATCH] Ensure pages have contextual navigation It would be good to know if it breaks! I didn't think it worth updating every single settings specs to test for this... But I've tested on the 'general settings' page because this is the default page when clicking on 'Configuration'. --- app/views/spree/admin/states/index.html.haml | 2 +- spec/system/admin/configuration/general_settings_spec.rb | 3 +++ spec/system/admin/configuration/states_spec.rb | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/spree/admin/states/index.html.haml b/app/views/spree/admin/states/index.html.haml index 6e515f23a3..57035c79af 100644 --- a/app/views/spree/admin/states/index.html.haml +++ b/app/views/spree/admin/states/index.html.haml @@ -1,4 +1,4 @@ -dmin= render partial: 'spree/admin/shared/configuration_menu' += render partial: 'spree/admin/shared/configuration_menu' - content_for :page_title do = t("spree.states") diff --git a/spec/system/admin/configuration/general_settings_spec.rb b/spec/system/admin/configuration/general_settings_spec.rb index 5f2f33c921..9572a1b8d4 100644 --- a/spec/system/admin/configuration/general_settings_spec.rb +++ b/spec/system/admin/configuration/general_settings_spec.rb @@ -17,6 +17,9 @@ RSpec.describe "General Settings" do expect(page).to have_content("General Settings") expect(find("#site_name").value).to eq("OFN Demo Site") expect(find("#site_url").value).to eq("demo.openfoodnetwork.org") + + # and it has contextual navigation + expect(page).to have_link "General Settings" end end diff --git a/spec/system/admin/configuration/states_spec.rb b/spec/system/admin/configuration/states_spec.rb index 0653a429f3..9512415f85 100644 --- a/spec/system/admin/configuration/states_spec.rb +++ b/spec/system/admin/configuration/states_spec.rb @@ -35,6 +35,9 @@ RSpec.describe "States" do it "should correctly display the states" do visit spree.admin_country_states_path(country) expect(page).to have_content(state.name) + + # and it has contextual navigation + expect(page).to have_link "General Settings" end end