Skip to content

Commit 72b2d60

Browse files
committed
Update feature tests to cover adding a "None of the above" question
1 parent df04fc6 commit 72b2d60

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

spec/features/form/add_or_edit_questions/add_a_question_for_each_type_of_answer_spec.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
create(:membership, group:, user: standard_user, added_by: standard_user)
99

1010
login_as standard_user
11+
12+
allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled).and_return(true)
1113
end
1214

1315
context "when a form has no existing pages" do
@@ -222,7 +224,13 @@ def fill_in_selection_options(options)
222224
fill_in "Option 2", with: options[1]
223225
click_button "Add another option"
224226
fill_in "Option 3", with: options[2]
225-
choose "Yes"
227+
choose "Yes, and let people provide a different answer"
228+
click_button "Continue"
229+
230+
expect(page.find("h1")).to have_text "Ask for an answer if someone selects ‘None of the above’"
231+
expect_page_to_have_no_axe_errors(page)
232+
fill_in "Enter a question or label for the text box", with: "Enter your own option"
233+
choose "Mandatory"
226234
click_button "Continue"
227235

228236
click_link "Change Options"

0 commit comments

Comments
 (0)