From c56e6152a2c5c20b59f26b274a03dd40779e5002 Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 10 Jun 2022 11:26:59 +0100 Subject: [PATCH] moved test --- spec/requests/schemes_controller_spec.rb | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 48d518d9a..13e612c46 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -29,6 +29,20 @@ RSpec.describe SchemesController, type: :request do end end + context "when signed in as a data coordinator user" do + let(:user) { FactoryBot.create(:user, :data_coordinator) } + + before do + sign_in user + get "/supported-housing" + end + + it "redirects to the organisation schemes path" do + follow_redirect! + expect(path).to match("/organisations/#{user.organisation.id}/supported-housing") + end + end + context "when signed in as a support user" do before do allow(user).to receive(:need_two_factor_authentication?).and_return(false) @@ -145,19 +159,5 @@ RSpec.describe SchemesController, type: :request do end end end - - context "when signed in as a data coordinator user" do - let(:user) { FactoryBot.create(:user, :data_coordinator) } - - before do - sign_in user - get "/supported-housing" - end - - it "redirects to the organisation schemes path" do - follow_redirect! - expect(path).to match("/organisations/#{user.organisation.id}/supported-housing") - end - end end end