|
|
|
@ -103,6 +103,16 @@ RSpec.describe LocationsController, type: :request do
|
|
|
|
|
expect(Location.last.wheelchair_adaptation).to eq("No") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when required organisation id param is missing" do |
|
|
|
|
let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "No" } } } |
|
|
|
|
|
|
|
|
|
it "displays the new page with an error message" do |
|
|
|
|
post "/schemes/#{scheme.id}/location/create", params: params |
|
|
|
|
expect(response).to have_http_status(:unprocessable_entity) |
|
|
|
|
expect(page).to have_content(I18n.t("validations.postcode")) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when do you want to add another location is selected as yes" do |
|
|
|
|
let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "Yes", postcode: "ZZ1 1ZZ" } } } |
|
|
|
|
|
|
|
|
|