diff --git a/app/models/form/sales/pages/la_nominations.rb b/app/models/form/sales/pages/la_nominations.rb new file mode 100644 index 000000000..c5c775e9f --- /dev/null +++ b/app/models/form/sales/pages/la_nominations.rb @@ -0,0 +1,15 @@ +class Form::Sales::Pages::LaNominations < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "la_nominations" + @header = "" + @description = "" + @subsection = subsection + end + + def questions + @questions ||= [ + Form::Sales::Questions::LaNominations.new(nil, nil, self), + ] + end +end diff --git a/app/models/form/sales/questions/la_nominations.rb b/app/models/form/sales/questions/la_nominations.rb new file mode 100644 index 000000000..5db0178b6 --- /dev/null +++ b/app/models/form/sales/questions/la_nominations.rb @@ -0,0 +1,18 @@ +class Form::Sales::Questions::LaNominations < ::Form::Question + def initialize(id, hsh, page) + super + @id = "lanomagr" + @check_answer_label = "Household rehoused under a local authority nominations agreement?" + @header = "Was the household rehoused under a 'local authority nominations agreement'?" + @type = "radio" + @answer_options = ANSWER_OPTIONS + @page = page + @hint_text = "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing" + end + + ANSWER_OPTIONS = { + "1" => { "value" => "Yes" }, + "2" => { "value" => "No" }, + "3" => { "value" => "Don’t know" }, + }.freeze +end diff --git a/spec/models/form/sales/pages/staircase_spec.rb b/spec/models/form/sales/pages/la_nominations_spec.rb similarity index 76% rename from spec/models/form/sales/pages/staircase_spec.rb rename to spec/models/form/sales/pages/la_nominations_spec.rb index d2155f972..02b44ccb5 100644 --- a/spec/models/form/sales/pages/staircase_spec.rb +++ b/spec/models/form/sales/pages/la_nominations_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -RSpec.describe Form::Sales::Pages::Staircase, type: :model do +RSpec.describe Form::Sales::Pages::LaNominations, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection) } let(:page_id) { nil } @@ -12,11 +12,11 @@ RSpec.describe Form::Sales::Pages::Staircase, type: :model do end it "has correct questions" do - expect(page.questions.map(&:id)).to eq(%w[staircase]) + expect(page.questions.map(&:id)).to eq(%w[lanomagr]) end it "has the correct id" do - expect(page.id).to eq("staircasing") + expect(page.id).to eq("la_nominations") end it "has the correct header" do diff --git a/spec/models/form/sales/questions/staircase_spec.rb b/spec/models/form/sales/questions/la_nominations_spec.rb similarity index 60% rename from spec/models/form/sales/questions/staircase_spec.rb rename to spec/models/form/sales/questions/la_nominations_spec.rb index 845e5242e..bb06ef014 100644 --- a/spec/models/form/sales/questions/staircase_spec.rb +++ b/spec/models/form/sales/questions/la_nominations_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -RSpec.describe Form::Sales::Questions::Staircase, type: :model do +RSpec.describe Form::Sales::Questions::LaNominations, type: :model do subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } @@ -12,15 +12,15 @@ RSpec.describe Form::Sales::Questions::Staircase, type: :model do end it "has the correct id" do - expect(question.id).to eq("staircase") + expect(question.id).to eq("lanomagr") end it "has the correct header" do - expect(question.header).to eq("Is this a staircasing transaction?") + expect(question.header).to eq("Was the household rehoused under a 'local authority nominations agreement'?") end it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Staircasing transaction") + expect(question.check_answer_label).to eq("Household rehoused under a local authority nominations agreement?") end it "has the correct type" do @@ -44,6 +44,6 @@ RSpec.describe Form::Sales::Questions::Staircase, type: :model do end it "has the correct hint" do - expect(question.hint_text).to eq("A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property") + expect(question.hint_text).to eq("A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing") end end