Browse Source

CLDC-1850 add don't know option to buyer 1 previous tenure (#1345)

* add don't know option to buyer 1 previous tenure

* some minor tidying and reformatiing
pull/1343/head^2
Arthur Campbell 2 years ago committed by GitHub
parent
commit
7b43250c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      app/models/form/sales/questions/buyer1_previous_tenure.rb
  2. 4
      spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb
  3. 5
      spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb

9
app/models/form/sales/questions/buyer1_previous_tenure.rb

@ -5,10 +5,11 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question
@check_answer_label = "Buyer 1’s previous tenure" @check_answer_label = "Buyer 1’s previous tenure"
@header = "What was buyer 1’s previous tenure?" @header = "What was buyer 1’s previous tenure?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = answer_options
end end
ANSWER_OPTIONS = { def answer_options
{
"1" => { "value" => "Local Authority" }, "1" => { "value" => "Local Authority" },
"2" => { "value" => "Private registered provider or housing association tenant" }, "2" => { "value" => "Private registered provider or housing association tenant" },
"3" => { "value" => "Private tenant" }, "3" => { "value" => "Private tenant" },
@ -17,5 +18,7 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question
"6" => { "value" => "Living with family or friends" }, "6" => { "value" => "Living with family or friends" },
"7" => { "value" => "Temporary accomodation" }, "7" => { "value" => "Temporary accomodation" },
"9" => { "value" => "Other" }, "9" => { "value" => "Other" },
}.freeze "0" => { "value" => "Don’t know" },
}
end
end end

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

@ -1,10 +1,8 @@
require "rails_helper" require "rails_helper"
RSpec.describe Form::Sales::Pages::Buyer1PreviousTenure, type: :model do RSpec.describe Form::Sales::Pages::Buyer1PreviousTenure, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection) } subject(:page) { described_class.new(nil, nil, subsection) }
let(:page_id) { nil }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:subsection) { instance_double(Form::Subsection) }
it "has correct subsection" do it "has correct subsection" do

5
spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb

@ -1,10 +1,8 @@
require "rails_helper" require "rails_helper"
RSpec.describe Form::Sales::Questions::Buyer1PreviousTenure, type: :model do RSpec.describe Form::Sales::Questions::Buyer1PreviousTenure, type: :model do
subject(:question) { described_class.new(question_id, question_definition, page) } subject(:question) { described_class.new(nil, nil, page) }
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) } let(:page) { instance_double(Form::Page) }
let(:log) { create(:sales_log) } let(:log) { create(:sales_log) }
@ -42,6 +40,7 @@ RSpec.describe Form::Sales::Questions::Buyer1PreviousTenure, type: :model do
"6" => { "value" => "Living with family or friends" }, "6" => { "value" => "Living with family or friends" },
"7" => { "value" => "Temporary accomodation" }, "7" => { "value" => "Temporary accomodation" },
"9" => { "value" => "Other" }, "9" => { "value" => "Other" },
"0" => { "value" => "Don’t know" },
}) })
end end
end end

Loading…
Cancel
Save