skill-assessment-app/test/mailers/user_mailer_test.rb
Mark Moser d5a469d736 user mailers
completes #25
2016-08-24 16:34:09 -05:00

21 lines
473 B
Ruby

require 'test_helper'
class UserMailerTest < ActionMailer::TestCase
test "password_reset" do
user = users(:admin)
user.setup_reset
mail = UserMailer.password_reset user
assert_equal [user.email], mail.to
assert_match user.reset_token, mail.body.encoded
end
test "welcome" do
user = users(:admin)
mail = UserMailer.welcome user, 'p0o9i8u7'
assert_equal [user.email], mail.to
assert_match 'p0o9i8u7', mail.body.encoded
end
end