|
|
|
@ -91,22 +91,16 @@ RSpec.describe CheckAnswersHelper do
|
|
|
|
|
|
|
|
|
|
context "conditional questions with type that hasn't been implemented yet" do |
|
|
|
|
let(:unimplemented_conditional) do |
|
|
|
|
{ "question_1" => |
|
|
|
|
{ "previous_postcode" => |
|
|
|
|
{ "header" => "The actual question?", |
|
|
|
|
"hint_text" => "", |
|
|
|
|
"type" => "date", |
|
|
|
|
"check_answer_label" => "Question Label", |
|
|
|
|
"conditional_for" => { "question_2" => %w[12-12-2021] } }, |
|
|
|
|
"question_2" => |
|
|
|
|
{ "header" => "The second actual question?", |
|
|
|
|
"hint_text" => "", |
|
|
|
|
"type" => "radio", |
|
|
|
|
"check_answer_label" => "The second question label", |
|
|
|
|
"answer_options" => { "0" => "Yes", "1" => "No" } } } |
|
|
|
|
"conditional_for" => { "question_2" => %w[12-12-2021] } } } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "raises an error" do |
|
|
|
|
allow_any_instance_of(Form).to receive(:questions_for_subsection).and_return(unimplemented_conditional) |
|
|
|
|
allow_any_instance_of(Form).to receive(:pages_for_subsection).and_return(unimplemented_conditional) |
|
|
|
|
expect { total_number_of_questions(subsection, case_log, form) }.to raise_error(RuntimeError, "Not implemented yet") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|