Browse Source

CLDC-2640 Add location guidance (#1978)

* Add location guidance

* update content

* Add question specs
pull/2002/head
kosiakkatrina 1 year ago committed by GitHub
parent
commit
0af2327993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/models/form/lettings/pages/location.rb
  2. 1
      app/models/form/lettings/questions/location_id.rb
  3. 4
      app/views/form/guidance/_finding_location.erb
  4. 2
      spec/models/form/lettings/pages/location_spec.rb
  5. 11
      spec/models/form/lettings/questions/location_id_spec.rb

1
app/models/form/lettings/pages/location.rb

@ -7,6 +7,7 @@ class Form::Lettings::Pages::Location < ::Form::Page
"scheme_has_multiple_locations?" => true,
},
]
@header = "Location"
@next_unresolved_page_id = :check_answers
end

1
app/models/form/lettings/questions/location_id.rb

@ -13,6 +13,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question
}
@question_number = 10
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@top_guidance_partial = "finding_location"
end
def answer_options

4
app/views/form/guidance/_finding_location.erb

@ -0,0 +1,4 @@
<%= govuk_details(summary_text: "What is a location?") do %>
<p class="govuk-body">A location is a postcode where supported housing is provided under a scheme. A scheme can have multiple locations, and a location can have multiple units at the same postcode.</p>
<p class="govuk-body"><%= govuk_link_to("Read more about schemes and locations", scheme_changes_path) %></p>
<% end %>

2
spec/models/form/lettings/pages/location_spec.rb

@ -26,7 +26,7 @@ RSpec.describe Form::Lettings::Pages::Location, type: :model do
end
it "has the correct header" do
expect(page.header).to be_nil
expect(page.header).to eq("Location")
end
it "has the correct description" do

11
spec/models/form/lettings/questions/location_id_spec.rb

@ -151,4 +151,15 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do
expect(question.header).to eq("Which location is this letting for?")
end
end
describe "partial guidance" do
it "shows shows correct top_guidance_partial" do
expect(question.top_guidance_partial).to eq("finding_location")
end
it "is at the top" do
expect(question.top_guidance?).to eq(true)
expect(question.bottom_guidance?).to eq(false)
end
end
end

Loading…
Cancel
Save