Skip to content
Merged
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 spec/end_to_end/end_to_end_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
add_a_single_line_of_text_question(question_text)
add_a_single_line_of_text_question(alternate_question_text)

first(:link, "your questions").click
click_link "your questions", match: :first

add_a_route selection_question, if_the_answer_selected_is: "Yes", skip_the_person_to: alternate_question_text
add_a_secondary_skip last_question_before_skip: question_text, question_to_skip_to: "Check your answers before submitting"
Expand Down
11 changes: 11 additions & 0 deletions spec/support/feature_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,13 @@ def form_is_filled_in_by_form_filler(live_form_link, yes_branch: false, confirma
end
# rubocop:enable Style/IdenticalConditionalBranches

if filler_answer_email_enabled?
logger.info "And I am asked if I want a copy of my answers"
expect(page.find("h1")).to have_content "Do you want to get an email with a copy of your answers?"
choose "No", visible: false
click_button "Continue"
end

logger.info "Then I can check my answers before I submit them"
expect(page).to have_content "Check your answers before submitting your form"
expect(page).to have_content "What is your favourite colour?"
Expand Down Expand Up @@ -580,6 +587,10 @@ def skip_file_upload?
ENV.fetch("SKIP_FILE_UPLOAD", false)
end

def filler_answer_email_enabled?
Settings.features.filler_answer_email_enabled
end

def visit_product_page
logger.info "Visiting product pages at #{forms_product_page_url}"
visit forms_product_page_url
Expand Down
Loading