Browse Source

testing not being able to view any other orgs supported housing for coordinator user

pull/648/head
JG 3 years ago
parent
commit
4d842a5347
  1. 12
      spec/requests/organisations_controller_spec.rb

12
spec/requests/organisations_controller_spec.rb

@ -127,6 +127,18 @@ RSpec.describe OrganisationsController, type: :request do
end end
end end
context "with schemes that are not in scope for the user, i.e. that they do not belong to" do
let!(:unauthorised_organisation) { FactoryBot.create(:organisation) }
before do
get "/organisations/#{unauthorised_organisation.id}/supported-housing", headers:, params: {}
end
it "returns not found 404 from org details route" do
expect(response).to have_http_status(:not_found)
end
end
context "when searching" do context "when searching" do
let!(:searched_scheme) { FactoryBot.create(:scheme, code: "CODE321", organisation: user.organisation) } let!(:searched_scheme) { FactoryBot.create(:scheme, code: "CODE321", organisation: user.organisation) }
let(:search_param) { "CODE321" } let(:search_param) { "CODE321" }

Loading…
Cancel
Save