Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix highlighting of "Consultations" in main navigation

Broken by 4b5f570.

This is a band-aid over the underlying problem that there are
no tests keeping current_main_navigation_path in sync with the
contents of the #global-nav element in website.html.erb.

I haven't fixed that here since it requires a decision about
whether to simply write such tests against the current code,
or rewrite that code to remove duplication between #global-nav
and the helper (e.g. use params instead of named route helpers
in the main_navigation_link_to calls in #global-nav), or both.
  • Loading branch information...
commit 2d63888fa44bd059a1f79571906bfdf78557ff3a 1 parent 7b39cda
Tom Stuart authored
2  app/helpers/application_helper.rb
View
@@ -138,7 +138,7 @@ def current_main_navigation_path(parameters)
when "publications"
publications_path
when "consultations", "consultation_responses"
- open_consultations_path
+ consultations_path
when "ministerial_roles"
ministerial_roles_path
when "organisations"
10 test/unit/helpers/application_helper_test.rb
View
@@ -113,11 +113,11 @@ class ApplicationHelperTest < ActionView::TestCase
end
test "consultation-related pages should be related to consulatations main navigation" do
- assert_equal open_consultations_path, current_main_navigation_path(controller: "consultations", action: "index")
- assert_equal open_consultations_path, current_main_navigation_path(controller: "consultations", action: "open")
- assert_equal open_consultations_path, current_main_navigation_path(controller: "consultations", action: "closed")
- assert_equal open_consultations_path, current_main_navigation_path(controller: "consultations", action: "show")
- assert_equal open_consultations_path, current_main_navigation_path(controller: "consultation_responses", action: "show")
+ assert_equal consultations_path, current_main_navigation_path(controller: "consultations", action: "index")
+ assert_equal consultations_path, current_main_navigation_path(controller: "consultations", action: "open")
+ assert_equal consultations_path, current_main_navigation_path(controller: "consultations", action: "closed")
+ assert_equal consultations_path, current_main_navigation_path(controller: "consultations", action: "show")
+ assert_equal consultations_path, current_main_navigation_path(controller: "consultation_responses", action: "show")
end
test "minister-related pages should be related to ministers main navigation" do
Please sign in to comment.
Something went wrong with that request. Please try again.