Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit ffed912

Browse files
committed
Change value sent for 'None of the above' option for conditions
1 parent 82ec26f commit ffed912

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/models/condition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def warning_answer_doesnt_exist
4545
return nil if has_precondition? && answer_value.nil?
4646

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

5050
{ name: "answer_value_doesnt_exist" }
5151
end

spec/models/condition_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
end
190190

191191
context "when answer_value is 'None of the above" do
192-
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 }
192+
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" }
193193
let(:check_page) { create :page, :with_selections_settings, form:, is_optional: }
194194

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

0 commit comments

Comments
 (0)