Browse Source
soft validations models add a label file for this year so the export_codes tests have authentic labels to pull the old BU completed log answers throw the new soft validation. needed to change illness to 3 to avoid the soft validation as it should be a complete logCLDC-4105-working-situation-illness-soft-validation
7 changed files with 155 additions and 23 deletions
|
@ -0,0 +1,49 @@
|
||||
require "rails_helper" |
||||
|
||||
RSpec.describe Form::Lettings::Questions::WorkingSituationIllnessCheck, type: :model do |
||||
subject(:question) { described_class.new(question_id, question_definition, page, person_index: 1) } |
||||
|
||||
let(:question_id) { nil } |
||||
let(:question_definition) { nil } |
||||
let(:page) { instance_double(Form::Page, copy_key: nil) } |
||||
|
||||
it "has correct page" do |
||||
expect(question.page).to eq(page) |
||||
end |
||||
|
||||
it "has the correct id" do |
||||
expect(question.id).to eq("working_situation_illness_check") |
||||
end |
||||
|
||||
it "has the correct type" do |
||||
expect(question.type).to eq("interruption_screen") |
||||
end |
||||
|
||||
it "is not marked as derived" do |
||||
expect(question.derived?(nil)).to be false |
||||
end |
||||
|
||||
it "has a correct check_answers_card_number" do |
||||
expect(question.check_answers_card_number).to eq(1) |
||||
end |
||||
|
||||
it "has the correct answer_options" do |
||||
expect(question.answer_options).to eq({ |
||||
"0" => { "value" => "Yes" }, |
||||
"1" => { "value" => "No" }, |
||||
}) |
||||
end |
||||
|
||||
it "has the correct hidden_in_check_answers" do |
||||
expect(question.hidden_in_check_answers).to eq({ |
||||
"depends_on" => [ |
||||
{ |
||||
"working_situation_illness_check" => 0, |
||||
}, |
||||
{ |
||||
"working_situation_illness_check" => 1, |
||||
}, |
||||
], |
||||
}) |
||||
end |
||||
end |
||||
Loading…
Reference in new issue