Browse Source

some minor tidying and reformatiing

pull/1345/head
Arthur Campbell 3 years ago
parent
commit
83fc0089fa
  1. 26
      app/models/form/sales/questions/buyer1_previous_tenure.rb
  2. 4
      spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb
  3. 4
      spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb

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

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

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

@ -1,10 +1,8 @@
require "rails_helper"
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) }
it "has correct subsection" do

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

@ -1,10 +1,8 @@
require "rails_helper"
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) }
it "has correct page" do

Loading…
Cancel
Save