|
|
@ -132,7 +132,7 @@ RSpec.describe Form, type: :model do |
|
|
|
|
|
|
|
|
|
|
|
describe "invalidated_page_questions" do |
|
|
|
describe "invalidated_page_questions" do |
|
|
|
context "when dependencies are not met" do |
|
|
|
context "when dependencies are not met" do |
|
|
|
let(:expected_invalid) { %w[la_known cbl conditional_question_no_second_question net_income_value_check dependent_question layear declaration] } |
|
|
|
let(:expected_invalid) { %w[la_known cbl conditional_question_no_second_question net_income_value_check dependent_question offered layear declaration] } |
|
|
|
|
|
|
|
|
|
|
|
it "returns an array of question keys whose pages conditions are not met" do |
|
|
|
it "returns an array of question keys whose pages conditions are not met" do |
|
|
|
expect(form.invalidated_page_questions(case_log).map(&:id).uniq).to eq(expected_invalid) |
|
|
|
expect(form.invalidated_page_questions(case_log).map(&:id).uniq).to eq(expected_invalid) |
|
|
@ -140,7 +140,7 @@ RSpec.describe Form, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "with two pages having the same question and only one has dependencies met" do |
|
|
|
context "with two pages having the same question and only one has dependencies met" do |
|
|
|
let(:expected_invalid) { %w[la_known cbl conditional_question_no_second_question net_income_value_check dependent_question layear declaration] } |
|
|
|
let(:expected_invalid) { %w[la_known cbl conditional_question_no_second_question net_income_value_check dependent_question offered layear declaration] } |
|
|
|
|
|
|
|
|
|
|
|
it "returns an array of question keys whose pages conditions are not met" do |
|
|
|
it "returns an array of question keys whose pages conditions are not met" do |
|
|
|
case_log["preg_occ"] = "No" |
|
|
|
case_log["preg_occ"] = "No" |
|
|
|