Browse Source

Update whellchair hint text (#2226)

pull/2231/head
kosiakkatrina 11 months ago committed by GitHub
parent
commit
e4c63b3602
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  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?" @header = "Is the property built or adapted to wheelchair-user standards?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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 @answer_options = ANSWER_OPTIONS
@question_number = 21 @question_number = 21
end end

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

@ -7,6 +7,7 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = 17 @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 end
ANSWER_OPTIONS = { 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) } 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 it "has correct subsection" do
expect(page.subsection).to be(subsection) expect(page.subsection).to be(subsection)
end 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) } subject(:question) { described_class.new(nil, nil, page) }
let(:page) { instance_double(Form::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 it "has correct page" do
expect(question.page).to eq(page) 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 it "is not marked as derived" do
expect(question.derived?).to be false expect(question.derived?).to be false
end 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 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(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } 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 it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)
end 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_id) { nil }
let(:question_definition) { nil } let(:question_definition) { nil }
let(:page) { instance_double(Form::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 it "has correct page" do
expect(question.page).to eq(page) expect(question.page).to eq(page)
@ -38,4 +44,14 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode
"3" => { "value" => "Don't know" }, "3" => { "value" => "Don't know" },
}) })
end 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 end

Loading…
Cancel
Save