Browse Source

added wheelchair adaptions to the unit tyupe

pull/704/head
JG 3 years ago
parent
commit
0615427bf3
  1. 2
      app/views/schemes/check_answers.html.erb
  2. 4
      spec/requests/locations_controller_spec.rb

2
app/views/schemes/check_answers.html.erb

@ -94,7 +94,7 @@
<% row.cell(text: location.id) %> <% row.cell(text: location.id) %>
<% row.cell(text: simple_format(location_cell(location), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> <% row.cell(text: simple_format(location_cell(location), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %>
<% row.cell(text: location.total_units) %> <% row.cell(text: location.total_units) %>
<% row.cell(text: location.type_of_unit) %> <% row.cell(text: simple_format("<span>#{location.type_of_unit}</span>#{location.wheelchair_adaptation == "Yes" ? "\n<span class=\"govuk-!-font-weight-regular app-!-colour-muted\">With wheelchair adaptations</span>" : ""}")) %>
<% row.cell(text: "Delete") %> <% row.cell(text: "Delete") %>
<% end %> <% end %>
<% end %> <% end %>

4
spec/requests/locations_controller_spec.rb

@ -81,7 +81,7 @@ RSpec.describe LocationsController, type: :request do
context "when signed in as a data coordinator" do context "when signed in as a data coordinator" do
let(:user) { FactoryBot.create(:user, :data_coordinator) } let(:user) { FactoryBot.create(:user, :data_coordinator) }
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) }
let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "No" } } } let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "No", postcode: "ZZ1 1ZZ" } } }
before do before do
sign_in user sign_in user
@ -104,7 +104,7 @@ RSpec.describe LocationsController, type: :request do
end end
context "when do you want to add another location is selected as yes" do 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" } } } let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "Yes", postcode: "ZZ1 1ZZ" } } }
it "creates a new location for scheme with valid params and redirects to correct page" do it "creates a new location for scheme with valid params and redirects to correct page" do
expect { post "/schemes/#{scheme.id}/location/create", params: }.to change(Location, :count).by(1) expect { post "/schemes/#{scheme.id}/location/create", params: }.to change(Location, :count).by(1)

Loading…
Cancel
Save