Browse Source

Fix question number rendering

pull/1467/head
Jack S 3 years ago
parent
commit
0296712421
  1. 2
      app/models/form/lettings/pages/address.rb
  2. 2
      app/models/form/lettings/questions/address_line1.rb
  3. 2
      app/models/form/sales/pages/address.rb
  4. 2
      app/models/form/sales/questions/address_line1.rb
  5. 2
      spec/models/form/lettings/pages/address_spec.rb
  6. 4
      spec/models/form/lettings/questions/address_line1_spec.rb
  7. 2
      spec/models/form/sales/pages/address_spec.rb
  8. 4
      spec/models/form/sales/questions/address_line1_spec.rb

2
app/models/form/lettings/pages/address.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::Address < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "address" @id = "address"
@header = "What is the property's address?" @header = "Q12 - What is the property's address?"
end end
def questions def questions

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

@ -6,7 +6,7 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question
@header = "Address line 1" @header = "Address line 1"
@type = "text" @type = "text"
@plain_label = true @plain_label = true
@question_number = 12 @check_answer_label = "Q12 - Address"
end end
def hidden_in_check_answers?(log, _current_user = nil) def hidden_in_check_answers?(log, _current_user = nil)

2
app/models/form/sales/pages/address.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::Address < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "address" @id = "address"
@header = "What is the property's address?" @header = "Q15 - What is the property's address?"
end end
def questions def questions

2
app/models/form/sales/questions/address_line1.rb

@ -6,7 +6,7 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question
@header = "Address line 1" @header = "Address line 1"
@type = "text" @type = "text"
@plain_label = true @plain_label = true
@question_number = 15 @check_answer_label = "Q15 - Address"
end end
def hidden_in_check_answers?(log, _current_user = nil) def hidden_in_check_answers?(log, _current_user = nil)

2
spec/models/form/lettings/pages/address_spec.rb

@ -20,7 +20,7 @@ RSpec.describe Form::Lettings::Pages::Address, type: :model do
end end
it "has the correct header" do it "has the correct header" do
expect(page.header).to eq("What is the property's address?") expect(page.header).to eq("Q12 - What is the property's address?")
end end
it "has the correct description" do it "has the correct description" do

4
spec/models/form/lettings/questions/address_line1_spec.rb

@ -20,11 +20,11 @@ RSpec.describe Form::Lettings::Questions::AddressLine1, type: :model do
end end
it "has the correct question_number" do it "has the correct question_number" do
expect(question.question_number).to eq(12) expect(question.question_number).to be_nil
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Address") expect(question.check_answer_label).to eq("Q12 - Address")
end end
it "has the correct type" do it "has the correct type" do

2
spec/models/form/sales/pages/address_spec.rb

@ -20,7 +20,7 @@ RSpec.describe Form::Sales::Pages::Address, type: :model do
end end
it "has the correct header" do it "has the correct header" do
expect(page.header).to eq("What is the property's address?") expect(page.header).to eq("Q15 - What is the property's address?")
end end
it "has the correct description" do it "has the correct description" do

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

@ -12,7 +12,7 @@ RSpec.describe Form::Sales::Questions::AddressLine1, type: :model do
end end
it "has the correct question_number" do it "has the correct question_number" do
expect(question.question_number).to eq(15) expect(question.question_number).to be_nil
end end
it "has the correct id" do it "has the correct id" do
@ -24,7 +24,7 @@ RSpec.describe Form::Sales::Questions::AddressLine1, type: :model do
end end
it "has the correct check_answer_label" do it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Address") expect(question.check_answer_label).to eq("Q15 - Address")
end end
it "has the correct type" do it "has the correct type" do

Loading…
Cancel
Save