From 1ca0efeb261f21fb7efe7fa1916b551ef8a99052 Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 10 Jun 2022 09:10:22 +0100 Subject: [PATCH] refactored specs moved into orgs what belongs there --- app/controllers/schemes_controller.rb | 2 +- spec/requests/organisations_controller_spec.rb | 4 ---- spec/requests/schemes_controller_spec.rb | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/schemes_controller.rb b/app/controllers/schemes_controller.rb index 430f89a65..ee0f7c5f0 100644 --- a/app/controllers/schemes_controller.rb +++ b/app/controllers/schemes_controller.rb @@ -6,7 +6,7 @@ class SchemesController < ApplicationController before_action :authenticate_scope! def index - redirect_to schemes_organisation_path(current_user.organisation) unless current_user.support? + redirect_to supported_housing_organisation_path(current_user.organisation) unless current_user.support? all_schemes = Scheme.all @pagy, @schemes = pagy(filtered_collection(all_schemes, search_term)) diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb index e67aa82e1..1f504c9f7 100644 --- a/spec/requests/organisations_controller_spec.rb +++ b/spec/requests/organisations_controller_spec.rb @@ -48,10 +48,6 @@ RSpec.describe OrganisationsController, type: :request do expect(page).to have_content("Supported housing services") end - it "redirects to the organisation schemes path" do - expect(path).to match("/organisations/#{user.organisation.id}/schemes") - end - it "shows a search bar" do expect(page).to have_field("search", type: "search") end diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 7dbbbc699..f8bc2c2da 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -151,9 +151,9 @@ RSpec.describe SchemesController, type: :request do get "/supported-housing" end - it "has page heading" do + it "redirects to the organisation schemes path" do follow_redirect! - expect(page).to have_content("Supported housing services") + expect(path).to match("/organisations/#{user.organisation.id}/supported-housing") end end end