Skip to content

Commit

Permalink
removed redundant link and amended tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syed87 committed May 31, 2024
1 parent 88719ab commit 7445fc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion app/views/teachers/mailer/magic_link.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Thank you for your interest in applying for qualified teacher status (QTS) in En
Welcome back to apply for qualified teacher status (QTS) in England. Use the link below to confirm your email address and sign in to your application.
<% end %>

<%= teacher_magic_link_url(token: @token) %>
[Confirm your email address](<%= teacher_magic_link_url(token: @token) %>)

Please note, this link will expire in <%= Devise.passwordless_login_within.inspect %>. After that time, you will need to [return to the service](<%= create_or_new_teacher_session_url %>) and request another confirmation link.
Expand Down
4 changes: 3 additions & 1 deletion spec/system/teacher_interface/authentication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ def and_i_receive_a_teacher_magic_link_email

def when_i_sign_in_using_magic_link
message = ActionMailer::Base.deliveries.last
uri = URI.parse(message.body.raw_source.lines.fifth.chomp)
link_line = message.body.raw_source.lines.fifth.chomp
url = link_line.match(/\((http[^)]+)\)/)[1]
uri = URI.parse(url)
expect(uri.path).to eq("/teacher/magic_link")
expect(uri.query).to include("token")
visit "#{uri.path}?#{uri.query}"
Expand Down

0 comments on commit 7445fc4

Please sign in to comment.