Skip to content

Commit

Permalink
Update order of mailing list funnel questions
Browse files Browse the repository at this point in the history
  • Loading branch information
emmaachesongray committed Jan 23, 2025
1 parent 80f69eb commit d9eedd1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
2 changes: 1 addition & 1 deletion app/models/mailing_list/wizard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class Wizard < ::GITWizard::Base
Steps::AlreadySubscribed,
Steps::ReturningTeacher,
Steps::AlreadyQualified,
Steps::Subject,
Steps::DegreeStatus,
Steps::TeacherTraining,
Steps::Subject,
Steps::Postcode,
].freeze

Expand Down
12 changes: 6 additions & 6 deletions app/views/event_steps/_personalised_updates.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

<p>These questions help us provide tailored guidance depending on your circumstances.</p>

<%= f.govuk_collection_select :preferred_teaching_subject_id,
f.object.teaching_subject_options,
:id,
:value,
options: { prompt: true } %>

<%= f.govuk_collection_select :degree_status_id,
f.object.degree_status_options,
:id,
Expand All @@ -14,12 +20,6 @@
:value,
options: { prompt: true } %>

<%= f.govuk_collection_select :preferred_teaching_subject_id,
f.object.teaching_subject_options,
:id,
:value,
options: { prompt: true } %>

<%= f.govuk_text_field :address_postcode, autocomplete: "postal-code" unless f.object.hide_postcode_field? %>

<details class="govuk-details">
Expand Down
57 changes: 29 additions & 28 deletions spec/features/mailing_list_wizard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
choose "No"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "Do you have a degree?"
choose "Not yet, I'm a first year student"
click_on "Next step"
Expand All @@ -32,10 +36,6 @@
choose "I'm not sure and finding out more"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "We'll only use this to send you information about events happening near you"
fill_in "What's your UK postcode? (optional)", with: "TE57 1NG"
click_on "Complete sign up"
Expand Down Expand Up @@ -65,6 +65,10 @@
choose "No"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "Do you have a degree?"
choose "Not yet, I'm a first year student"
click_on "Next step"
Expand All @@ -73,10 +77,6 @@
choose "I'm not sure and finding out more"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "We'll only use this to send you information about events happening near you"
fill_in "What's your UK postcode? (optional)", with: "TE57 1NG"
click_on "Complete sign up"
Expand Down Expand Up @@ -104,6 +104,10 @@
choose "No"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "Do you have a degree?"
choose "Almost, I'm a final year student"
click_on "Next step"
Expand All @@ -112,10 +116,6 @@
choose "I'm not sure and finding out more"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "We'll only use this to send you information about events happening near you"
fill_in "What's your UK postcode? (optional)", with: "TE57 1NG"
click_on "Complete sign up"
Expand Down Expand Up @@ -143,6 +143,10 @@
choose "No"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "Do you have a degree?"
choose "Not yet, I'm a first year student"
click_on "Next step"
Expand All @@ -151,10 +155,6 @@
choose "I'm not sure and finding out more"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "We'll only use this to send you information about events happening near you"
fill_in "What's your UK postcode? (optional)", with: "TE57 1NG"
click_on "Complete sign up"
Expand Down Expand Up @@ -191,6 +191,13 @@
choose "No"
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
expect(page).to have_select(
"Select the subject you're most interested in teaching",
selected: Crm::TeachingSubject.lookup_by_uuid(response.preferred_teaching_subject_id),
)
click_on "Next step"

expect(page).to have_text "Do you have a degree?"
expect(find("[name=\"mailing_list_steps_degree_status[degree_status_id]\"][checked]").value).to eq(
response.degree_status_id.to_s,
Expand All @@ -201,13 +208,6 @@
expect(find("[name=\"mailing_list_steps_teacher_training[consideration_journey_stage_id]\"][checked]").value).to eq(
response.consideration_journey_stage_id.to_s,
)
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
expect(page).to have_select(
"Select the subject you're most interested in teaching",
selected: Crm::TeachingSubject.lookup_by_uuid(response.preferred_teaching_subject_id),
)
click_on "Complete sign up"

expect(page).to have_text "Joey, you're signed up"
Expand Down Expand Up @@ -327,12 +327,17 @@
choose "No"
click_on "Next step"

expect(page).to have_text "Tell us more about you so that you only get emails relevant to your circumstances."
expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "Do you have a degree?"
expect(find("[name=\"mailing_list_steps_degree_status[degree_status_id]\"][checked]").value).to eq(
response.degree_status_id.to_s,
)

expect(page).to have_text "Tell us more about you so that you only get emails relevant to your circumstances."

click_on "Next step"

expect(page).to have_text "How close are you to applying"
Expand All @@ -341,10 +346,6 @@
)
click_on "Next step"

expect(page).to have_text "Select the subject you're most interested in teaching"
select "Maths"
click_on "Next step"

expect(page).to have_text "We'll only use this to send you information about events happening near you"
fill_in "What's your UK postcode? (optional)", with: ""
click_on "Complete sign up"
Expand Down

0 comments on commit d9eedd1

Please sign in to comment.