Browse Source

Update whellchair hint text

pull/2226/head
Kat 2 years ago
parent
commit
7ad8ca3bf1
  1. 2
      app/models/form/lettings/questions/wheelchair.rb
  2. 1
      app/models/form/sales/questions/property_wheelchair_accessible.rb
  3. 4
      spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb
  4. 16
      spec/models/form/lettings/questions/wheelchair_spec.rb
  5. 4
      spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb
  6. 16
      spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb

2
app/models/form/lettings/questions/wheelchair.rb

@ -6,7 +6,7 @@ class Form::Lettings::Questions::Wheelchair < ::Form::Question
@header = "Is the property built or adapted to wheelchair-user standards?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : ""
@answer_options = ANSWER_OPTIONS
@question_number = 21
end

1
app/models/form/sales/questions/property_wheelchair_accessible.rb

@ -7,6 +7,7 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 17
@hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : nil
end
ANSWER_OPTIONS = {

4
spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb

@ -5,6 +5,10 @@ RSpec.describe Form::Lettings::Pages::PropertyWheelchairAccessible, type: :model
let(:subsection) { instance_double(Form::Subsection) }
before do
allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false))
end
it "has correct subsection" do
expect(page.subsection).to be(subsection)
end

16
spec/models/form/lettings/questions/wheelchair_spec.rb

@ -4,6 +4,12 @@ RSpec.describe Form::Lettings::Questions::Wheelchair, type: :model do
subject(:question) { described_class.new(nil, nil, page) }
let(:page) { instance_double(Form::Page) }
let(:subsection) { instance_double(Form::Subsection) }
before do
allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false))
end
it "has correct page" do
expect(question.page).to eq(page)
@ -39,4 +45,14 @@ RSpec.describe Form::Lettings::Questions::Wheelchair, type: :model do
it "is not marked as derived" do
expect(question.derived?).to be false
end
context "with 2024 form" do
before do
allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true))
end
it "has the correct hint_text" do
expect(question.hint_text).to eq "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property."
end
end
end

4
spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb

@ -7,6 +7,10 @@ RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
before do
allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false))
end
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end

16
spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb

@ -6,6 +6,12 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) }
let(:subsection) { instance_double(Form::Subsection) }
before do
allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false))
end
it "has correct page" do
expect(question.page).to eq(page)
@ -38,4 +44,14 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode
"3" => { "value" => "Don't know" },
})
end
context "with 2024 form" do
before do
allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true))
end
it "has the correct hint_text" do
expect(question.hint_text).to eq("This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property.")
end
end
end

Loading…
Cancel
Save