diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb new file mode 100644 index 000000000..f7684701f --- /dev/null +++ b/spec/requests/schemes_controller_spec.rb @@ -0,0 +1,22 @@ +require "rails_helper" + +RSpec.describe SchemesController, type: :request do + let(:organisation) { user.organisation } + let(:headers) { { "Accept" => "text/html" } } + let(:page) { Capybara::Node::Simple.new(response.body) } + let(:user) { FactoryBot.create(:user, :data_coordinator) } + + describe "#index" do + context "when signed in as a support user" do + before do + allow(user).to receive(:need_two_factor_authentication?).and_return(false) + sign_in user + get "/supported-housing", headers:, params: + end + + it "shows the organisation list" do + expect(page).to have_content("Supported housing services") + end + end + end +end