Skip to content

Commit

Permalink
fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Sep 18, 2024
1 parent f6a89b4 commit 7000431
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<td style="padding-top: 20px;padding-bottom: 20px;mso-table-lspace:0pt;mso-table-rspace:0pt;">
<div style="word-break:break-word; border: 0; mso-border-alt: 0; text-align:center;">
<div style="display: inline-block; border: 0; mso-border-alt: 0;">
<a href="<%= @confirmation_url %>" style="direction:ltr;display:block;text-align:center;margin:0; font-family:Helvetica, Arial, Helvetica, sans-serif; font-size:16px; padding-top: 10px;padding-right: 20px;padding-bottom: 10px;padding-left: 20px; color:#ffffff;font-weight:normal;font-style:normal;text-decoration:none;border:0;background-color:#d4450c;border-radius:50px;mso-padding-alt:0;" target="_blank">
<a href="<%= @confirmation_url %>" id="confirm-link" style="direction:ltr;display:block;text-align:center;margin:0; font-family:Helvetica, Arial, Helvetica, sans-serif; font-size:16px; padding-top: 10px;padding-right: 20px;padding-bottom: 10px;padding-left: 20px; color:#ffffff;font-weight:normal;font-style:normal;text-decoration:none;border:0;background-color:#d4450c;border-radius:50px;mso-padding-alt:0;" target="_blank">
<span>Confirm Your Email Address</span>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion spec/features/newflow/educator_signup_flow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module Newflow
expect(current_email).to be_truthy

# ... with a link
verify_email_url = get_path_from_absolute_link(current_email, 'a')
verify_email_url = get_path_from_absolute_link(current_email, '#confirm-link')
visit(verify_email_url)

# Step 3
Expand Down
28 changes: 14 additions & 14 deletions spec/features/newflow/student_signup_flow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ module Newflow
before do
visit newflow_signup_path(r: '/external_app_for_specs')
find('.join-as__role.student').click
fill_in 'signup_first_name', with: 'Bryan'
fill_in 'signup_last_name', with: 'Dimas'
fill_in 'signup_first_name', with: 'Sally'
fill_in 'signup_last_name', with: 'Port'
fill_in 'signup_email', with: email
fill_in 'signup_password', with: password
submit_signup_form
Expand All @@ -43,10 +43,10 @@ module Newflow

example 'verify email by clicking link in the email' do
# ... with a link
verify_email_url = get_path_from_absolute_link(current_email, 'a')
verify_email_url = get_path_from_absolute_link(current_email, '#confirm-link')
visit verify_email_url
# ... which sends you to "sign up done page"
expect(page).to have_text(t(:"login_signup_form.youre_done", first_name: 'Bryan'))
expect(page).to have_text(t(:"login_signup_form.youre_done", first_name: 'Sally'))
screenshot!

# can exit and go back to the app they came from
Expand All @@ -62,7 +62,7 @@ module Newflow
screenshot!
click_on('commit')
# ... which sends you to "sign up done page"
expect(page).to have_text(t(:"login_signup_form.youre_done", first_name: 'Bryan'))
expect(page).to have_text(t(:"login_signup_form.youre_done", first_name: 'Sally'))
expect(page).to have_text(
strip_html(t(:"login_signup_form.youre_done_description", email_address: email))
)
Expand Down Expand Up @@ -106,8 +106,8 @@ module Newflow
example 'arriving from Tutor (a Doorkeeper app)' do
app = create_tutor_application
visit_authorize_uri(app: app, params: { go: 'student_signup' })
fill_in 'signup_first_name', with: 'Bryan'
fill_in 'signup_last_name', with: 'Dimas'
fill_in 'signup_first_name', with: 'Sally'
fill_in 'signup_last_name', with: 'Port'
fill_in 'signup_email', with: email
fill_in 'signup_password', with: password
submit_signup_form
Expand All @@ -126,7 +126,7 @@ module Newflow
click_on('commit')

# ... redirects you back to Tutor
expect(page).not_to have_text(t(:"login_signup_form.youre_done", first_name: 'Bryan'))
expect(page).not_to have_text(t(:"login_signup_form.youre_done", first_name: 'Sally'))
expect(page.current_path).to eq('/external_app_for_specs')
end

Expand All @@ -145,8 +145,8 @@ module Newflow
example 'user gets PIN wrong' do
visit newflow_signup_path(r: '/external_app_for_specs')
find('.join-as__role.student').click
fill_in 'signup_first_name', with: 'Bryan'
fill_in 'signup_last_name', with: 'Dimas'
fill_in 'signup_first_name', with: 'Sally'
fill_in 'signup_last_name', with: 'Port'
fill_in 'signup_email', with: email
fill_in 'signup_password', with: password
submit_signup_form
Expand All @@ -164,8 +164,8 @@ module Newflow
example 'user can change their initial email during the signup flow' do
visit newflow_signup_path(r: '/external_app_for_specs')
find('.join-as__role.student').click
fill_in 'signup_first_name', with: 'Bryan'
fill_in 'signup_last_name', with: 'Dimas'
fill_in 'signup_first_name', with: 'Sally'
fill_in 'signup_last_name', with: 'Port'
fill_in 'signup_email', with: email
fill_in 'signup_password', with: password
submit_signup_form
Expand All @@ -176,7 +176,7 @@ module Newflow
# capture_email!(address: email)
expect(current_email).to be_truthy
old_pin = current_email.find('b').text
old_confirmation_code_url = get_path_from_absolute_link(current_email, 'a')
old_confirmation_code_url = get_path_from_absolute_link(current_email, '#confirm-link')

# edit email
click_on('edit your email')
Expand All @@ -199,7 +199,7 @@ module Newflow
pin = current_email.find('b').text
expect(pin).not_to eq(old_pin)
# ...as well as a different confirmation code url
confirmation_code_url = get_path_from_absolute_link(current_email, 'a')
confirmation_code_url = get_path_from_absolute_link(current_email, '#confirm-link')
expect(confirmation_code_url).not_to eq(old_confirmation_code_url)

screenshot!
Expand Down

0 comments on commit 7000431

Please sign in to comment.