skill-assessment-app/test/mailers/user_mailer_test.rb

22 lines
503 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2016-08-24 16:26:07 -05:00
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