Skip to content

Commit 781f4c2

Browse files
committed
Add conditional step for CopyOfAnswers page
1 parent c052c84 commit 781f4c2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

spec/support/feature_helpers.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,13 @@ def form_is_filled_in_by_form_filler(live_form_link, yes_branch: false, confirma
359359
end
360360
# rubocop:enable Style/IdenticalConditionalBranches
361361

362+
if filler_answer_email_enabled?
363+
logger.info "And I am asked if I want a copy of my answers"
364+
expect(page.find("h1")).to have_content "Do you want to get an email with a copy of your answers?"
365+
choose "No", visible: false
366+
click_button "Continue"
367+
end
368+
362369
logger.info "Then I can check my answers before I submit them"
363370
expect(page).to have_content "Check your answers before submitting your form"
364371
expect(page).to have_content "What is your favourite colour?"
@@ -580,6 +587,10 @@ def skip_file_upload?
580587
ENV.fetch("SKIP_FILE_UPLOAD", false)
581588
end
582589

590+
def filler_answer_email_enabled?
591+
Settings.features.filler_answer_email_enabled
592+
end
593+
583594
def visit_product_page
584595
logger.info "Visiting product pages at #{forms_product_page_url}"
585596
visit forms_product_page_url

0 commit comments

Comments
 (0)