forked from fixin.me/fixin.me
Test registration e-mail
This commit is contained in:
@@ -10,6 +10,7 @@ class ActiveSupport::TestCase
|
||||
fixtures :all
|
||||
|
||||
include AbstractController::Translation
|
||||
include ActionMailer::TestHelper
|
||||
|
||||
def randomize_user_password!(user)
|
||||
random_password.tap { |p| user.update!(password: p) }
|
||||
@@ -22,4 +23,8 @@ class ActiveSupport::TestCase
|
||||
def random_email
|
||||
"%s@%s.%s" % (1..3).map { SecureRandom.alphanumeric(rand(1..20)) }
|
||||
end
|
||||
|
||||
def with_last_email
|
||||
yield(ActionMailer::Base.deliveries.last)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user