@ -28,7 +28,6 @@ module CheckAnswersHelper
def filter_conditional_questions(questions, case_log)
applicable_questions = questions
# puts applicable_questions.count
questions.each do |k, question|
question.fetch("conditional_for", []).each do |conditional_question_key, condition|
if condition_not_met(case_log, k, question, condition)
@ -98,9 +98,7 @@ RSpec.describe CheckAnswersHelper do
"hint_text" => "",
"type" => "date",
"check_answer_label" => "Question Label",
"conditional_for" => { "question_2" => %w[12-12-2021] }
}
"conditional_for" => { "question_2" => %w[12-12-2021] } } }
end
it "raises an error" do
@ -198,10 +198,11 @@ RSpec.describe Form, type: :model do
# Crossover over tests here as injured must be answered as well for no error
it "must be answered if ever served in the forces as a regular" do
expect {
expect do
CaseLog.create!(armed_forces: "Yes - a regular",
armed_forces_active: "Yes",
armed_forces_injured: "Yes")}
armed_forces_injured: "Yes")