diff --git a/app/helpers/navigation_items_helper.rb b/app/helpers/navigation_items_helper.rb
index 642aa22ab..799ecd864 100644
--- a/app/helpers/navigation_items_helper.rb
+++ b/app/helpers/navigation_items_helper.rb
@@ -45,19 +45,19 @@ private
end
def supported_housing_current?(path)
- path.include?("/supported-housing") && !organisations_current?(path)
+ path == "/supported-housing" || path.include?("/supported-housing/")
end
def organisations_current?(path)
- path == "/organisations" || subnav_users_path?(path) || subnav_logs_path?(path) || subnav_details_path?(path) || subnav_supported_housing_path?(path)
+ path == "/organisations" || path.include?("/organisations/")
end
def subnav_supported_housing_path?(path)
- path.include?("/organisations") && path.include?("/supported-housing")
+ path.include?("/organisations") && path.include?("/supported-housing") || path.include?("/supported-housing/")
end
def subnav_users_path?(path)
- path.include?("/organisations") && path.include?("/users")
+ path.include?("/organisations") && path.include?("/users") || path.include?("/users/")
end
def subnav_logs_path?(path)
diff --git a/spec/helpers/tab_nav_helper_spec.rb b/spec/helpers/tab_nav_helper_spec.rb
index 55b539a49..ba2dd3174 100644
--- a/spec/helpers/tab_nav_helper_spec.rb
+++ b/spec/helpers/tab_nav_helper_spec.rb
@@ -21,7 +21,7 @@ RSpec.describe TabNavHelper do
describe "#scheme_cell" do
it "returns the scheme link service name and primary user group separated by a newline character" do
- expected_html = "#{scheme.service_name}\nScheme #{scheme.primary_client_group}"
+ expected_html = "#{scheme.service_name}\nScheme #{scheme.primary_client_group_display}"
expect(scheme_cell(scheme)).to match(expected_html)
end
end