test/mailers/confirmation_instructions_test.rb in devise-3.2.4 vs test/mailers/confirmation_instructions_test.rb in devise-3.3.0
- old
+ new
@@ -51,11 +51,11 @@
assert_equal ['custom@example.com'], mail.from
end
test 'custom mailer renders parent mailer template' do
Devise.mailer = 'Users::Mailer'
- assert_not_blank mail.body.encoded
+ assert_present mail.body.encoded
end
test 'setup reply to as copy from sender' do
assert_equal ['test@example.com'], mail.reply_to
end
@@ -81,12 +81,12 @@
test 'body should have user info' do
assert_match user.email, mail.body.encoded
end
test 'body should have link to confirm the account' do
- host = ActionMailer::Base.default_url_options[:host]
+ host, port = ActionMailer::Base.default_url_options.values_at :host, :port
- if mail.body.encoded =~ %r{<a href=\"http://#{host}/users/confirmation\?confirmation_token=([^"]+)">}
+ if mail.body.encoded =~ %r{<a href=\"http://#{host}:#{port}/users/confirmation\?confirmation_token=([^"]+)">}
assert_equal Devise.token_generator.digest(user.class, :confirmation_token, $1), user.confirmation_token
else
flunk "expected confirmation url regex to match"
end
end