From 2c7b00757c57896004770bd9c71fb595746410a3 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 27 Sep 2022 13:56:06 +0100 Subject: [PATCH] update tests --- spec/factories/sales_log.rb | 1 + spec/helpers/question_attribute_helper_spec.rb | 4 ++-- spec/models/form/sales/questions/nationality1_spec.rb | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/factories/sales_log.rb b/spec/factories/sales_log.rb index 4f9aa07ed..2936d0d06 100644 --- a/spec/factories/sales_log.rb +++ b/spec/factories/sales_log.rb @@ -24,6 +24,7 @@ FactoryBot.define do age1_known { 0 } age1 { 30 } sex1 { "X" } + national { 18 } buy1livein { 1 } relat2 { "P" } proptype { 1 } diff --git a/spec/helpers/question_attribute_helper_spec.rb b/spec/helpers/question_attribute_helper_spec.rb index 96f2f7ef6..a007ec647 100644 --- a/spec/helpers/question_attribute_helper_spec.rb +++ b/spec/helpers/question_attribute_helper_spec.rb @@ -40,7 +40,7 @@ RSpec.describe QuestionAttributeHelper do "conditional_for" => { "next_question": ">1", }, - }, nil) + }, form.get_page("rent")) end let(:expected_attribs) do { @@ -48,7 +48,7 @@ RSpec.describe QuestionAttributeHelper do "data-action": "input->numeric-question#calculateFields click->conditional-question#displayConditional", "data-target": "lettings-log-#{question.result_field.to_s.dasherize}-field", "data-calculated": question.fields_to_add.to_json, - "data-info": question.conditional_for.to_json, + "data-info": { conditional_questions: question.conditional_for, log_type: "lettings" }.to_json } end diff --git a/spec/models/form/sales/questions/nationality1_spec.rb b/spec/models/form/sales/questions/nationality1_spec.rb index e3d8f832b..819d41ae4 100644 --- a/spec/models/form/sales/questions/nationality1_spec.rb +++ b/spec/models/form/sales/questions/nationality1_spec.rb @@ -40,8 +40,8 @@ RSpec.describe Form::Sales::Questions::Nationality1, type: :model do "18" => { "value" => "United Kingdom" }, "17" => { "value" => "Republic of Ireland" }, "19" => { "value" => "European Economic Area (EEA), excluding ROI" }, - "12" => { "value" => "Other " }, - "13" => { "value" => "Buyer prefers not to say " }, + "12" => { "value" => "Other" }, + "13" => { "value" => "Buyer prefers not to say" }, }) end