Browse Source

testing new scheme for a different org for coordinator

pull/704/head
JG 3 years ago
parent
commit
6d0291f1d8
  1. 9
      spec/requests/locations_controller_spec.rb

9
spec/requests/locations_controller_spec.rb

@ -40,6 +40,15 @@ RSpec.describe LocationsController, type: :request do
expect(response).to have_http_status(:ok) expect(response).to have_http_status(:ok)
expect(page).to have_content("Add a location to this scheme") expect(page).to have_content("Add a location to this scheme")
end end
context "when trying to new location to a scheme that belongs to another organisation" do
let(:another_scheme) { FactoryBot.create(:scheme) }
it "displays the new page with an error message" do
get "/schemes/#{another_scheme.id}/location/new"
expect(response).to have_http_status(:not_found)
end
end
end end
context "when signed in as a support user" do context "when signed in as a support user" do

Loading…
Cancel
Save