Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def warning_answer_doesnt_exist
return nil if has_precondition? && answer_value.nil?

answer_options = check_page&.answer_settings&.dig("selection_options")&.pluck("name")
return nil if answer_options.blank? || answer_options.include?(answer_value) || answer_value == :none_of_the_above.to_s && check_page.is_optional?
return nil if answer_options.blank? || answer_options.include?(answer_value) || answer_value == "None of the above" && check_page.is_optional?

{ name: "answer_value_doesnt_exist" }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/condition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
end

context "when answer_value is 'None of the above" do
let(:condition) { create :condition, routing_page_id: check_page.id, check_page_id: check_page.id, goto_page_id: goto_page.id, answer_value: :none_of_the_above.to_s }
let(:condition) { create :condition, routing_page_id: check_page.id, check_page_id: check_page.id, goto_page_id: goto_page.id, answer_value: "None of the above" }
let(:check_page) { create :page, :with_selections_settings, form:, is_optional: }

context "and routing page has 'None of the above' as an option" do
Expand Down