|
|
@ -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 |
|
|
|