diff --git a/app/controllers/case_logs_controller.rb b/app/controllers/case_logs_controller.rb index 6ac932b56..48fe5726d 100644 --- a/app/controllers/case_logs_controller.rb +++ b/app/controllers/case_logs_controller.rb @@ -136,7 +136,7 @@ private content["conditional_route_to"].each do |route, conditions| if conditions.keys.all? { |x| case_log[x].present? } && conditions.all? { |k, v| v.include?(case_log[k]) } return "case_log_#{route}_path" - end + end end end form.next_page_redirect_path(previous_page) diff --git a/app/helpers/check_answers_helper.rb b/app/helpers/check_answers_helper.rb index 92bedb2a0..5a8369ade 100644 --- a/app/helpers/check_answers_helper.rb +++ b/app/helpers/check_answers_helper.rb @@ -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) @@ -62,7 +61,7 @@ module CheckAnswersHelper when "radio" case_log[question_key].blank? || !condition.include?(case_log[question_key]) else - raise "Not implemented yet" end + raise "Not implemented yet" end end def create_update_answer_link(case_log_answer, case_log_id, page) diff --git a/spec/helpers/check_answers_helper_spec.rb b/spec/helpers/check_answers_helper_spec.rb index 38db2ef6b..5ac16b2bd 100644 --- a/spec/helpers/check_answers_helper_spec.rb +++ b/spec/helpers/check_answers_helper_spec.rb @@ -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 diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index d95f000a7..8ac7d349d 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -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") + end end end