|
|
|
|
@ -39,6 +39,10 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
|
|
|
|
|
expect(page.questions.map(&:id)).to eq(%w[student_not_child_value_check]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct affected_question_ids" do |
|
|
|
|
expect(page.affected_question_ids).to eq(%w[relat2 exstat2 age2]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 2" do |
|
|
|
|
let(:person_index) { 2 } |
|
|
|
|
let(:page_id) { "person_2_student_not_child_value_check" } |
|
|
|
|
@ -50,6 +54,10 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
|
|
|
|
|
it "has correct depends_on" do |
|
|
|
|
expect(page.depends_on).to eq([{ "person_2_student_not_child?" => true }]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct affected_question_ids" do |
|
|
|
|
expect(page.affected_question_ids).to eq(%w[relat2 exstat2 age2]) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 3" do |
|
|
|
|
@ -63,6 +71,10 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
|
|
|
|
|
it "has correct depends_on" do |
|
|
|
|
expect(page.depends_on).to eq([{ "person_3_student_not_child?" => true }]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct affected_question_ids" do |
|
|
|
|
expect(page.affected_question_ids).to eq(%w[relat3 exstat3 age3]) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 4" do |
|
|
|
|
@ -76,6 +88,10 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
|
|
|
|
|
it "has correct depends_on" do |
|
|
|
|
expect(page.depends_on).to eq([{ "person_4_student_not_child?" => true }]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct affected_question_ids" do |
|
|
|
|
expect(page.affected_question_ids).to eq(%w[relat4 exstat4 age4]) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 5" do |
|
|
|
|
@ -89,6 +105,10 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
|
|
|
|
|
it "has correct depends_on" do |
|
|
|
|
expect(page.depends_on).to eq([{ "person_5_student_not_child?" => true }]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct affected_question_ids" do |
|
|
|
|
expect(page.affected_question_ids).to eq(%w[relat5 exstat5 age5]) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 6" do |
|
|
|
|
@ -102,5 +122,9 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
|
|
|
|
|
it "has correct depends_on" do |
|
|
|
|
expect(page.depends_on).to eq([{ "person_6_student_not_child?" => true }]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct affected_question_ids" do |
|
|
|
|
expect(page.affected_question_ids).to eq(%w[relat6 exstat6 age6]) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|