Browse Source

moved test

pull/648/head
JG 3 years ago
parent
commit
c56e6152a2
  1. 28
      spec/requests/schemes_controller_spec.rb

28
spec/requests/schemes_controller_spec.rb

@ -29,6 +29,20 @@ RSpec.describe SchemesController, type: :request do
end 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
context "when signed in as a support user" do context "when signed in as a support user" do
before do before do
allow(user).to receive(:need_two_factor_authentication?).and_return(false) allow(user).to receive(:need_two_factor_authentication?).and_return(false)
@ -145,19 +159,5 @@ RSpec.describe SchemesController, type: :request do
end end
end 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
end end

Loading…
Cancel
Save