From 898e8f330c01622205f265149e110dfc86d18cc7 Mon Sep 17 00:00:00 2001 From: JG Date: Wed, 8 Jun 2022 16:14:19 +0100 Subject: [PATCH] fixed failing specs --- app/helpers/navigation_items_helper.rb | 5 +++++ spec/helpers/navigation_items_helper_spec.rb | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/helpers/navigation_items_helper.rb b/app/helpers/navigation_items_helper.rb index 1ebf17d11..5b0e42c20 100644 --- a/app/helpers/navigation_items_helper.rb +++ b/app/helpers/navigation_items_helper.rb @@ -7,6 +7,7 @@ module NavigationItemsHelper NavigationItem.new("Organisations", organisations_path, organisations_current?(path)), NavigationItem.new("Users", "/users", users_current?(path)), NavigationItem.new("Logs", case_logs_path, logs_current?(path)), + NavigationItem.new("Supported housing", "/supported-housing", supported_housing_current?(path)), ] else [ @@ -35,6 +36,10 @@ private path == "/users" end + def supported_housing_current?(path) + path == "/supported-housing" + end + def organisations_current?(path) path == "/organisations" || subnav_users_path?(path) || subnav_logs_path?(path) || subnav_details_path?(path) end diff --git a/spec/helpers/navigation_items_helper_spec.rb b/spec/helpers/navigation_items_helper_spec.rb index 641c6bd5c..779c8d2da 100644 --- a/spec/helpers/navigation_items_helper_spec.rb +++ b/spec/helpers/navigation_items_helper_spec.rb @@ -110,7 +110,7 @@ RSpec.describe NavigationItemsHelper do end it "returns navigation items with the users item set as current" do - expect(primary_items("/logs", current_user)).to eq(expected_navigation_items) + expect(primary_items("/supported-housing", current_user)).to eq(expected_navigation_items) end end @@ -122,6 +122,7 @@ RSpec.describe NavigationItemsHelper do NavigationItemsHelper::NavigationItem.new("Organisations", "/organisations", true), NavigationItemsHelper::NavigationItem.new("Users", "/users", false), NavigationItemsHelper::NavigationItem.new("Logs", "/logs", false), + NavigationItemsHelper::NavigationItem.new("Supported housing", "/supported-housing", false), ] end @@ -146,6 +147,7 @@ RSpec.describe NavigationItemsHelper do NavigationItemsHelper::NavigationItem.new("Organisations", "/organisations", true), NavigationItemsHelper::NavigationItem.new("Users", "/users", false), NavigationItemsHelper::NavigationItem.new("Logs", "/logs", false), + NavigationItemsHelper::NavigationItem.new("Supported housing", "/supported-housing", false), ] end @@ -170,6 +172,7 @@ RSpec.describe NavigationItemsHelper do NavigationItemsHelper::NavigationItem.new("Organisations", "/organisations", true), NavigationItemsHelper::NavigationItem.new("Users", "/users", false), NavigationItemsHelper::NavigationItem.new("Logs", "/logs", false), + NavigationItemsHelper::NavigationItem.new("Supported housing", "/supported-housing", false), ] end