Created
December 10, 2015 06:03
-
-
Save pinzolo/8bd9271791d902efb624 to your computer and use it in GitHub Desktop.
システムでメールアドレスを変更しても変更メールを送信しない
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def change_user_email(user) | |
user.email = '[email protected]' | |
user.skip_reconfirmation! | |
user.save | |
end | |
# テストコード | |
test 'ユーザーのメールアドレスを変更しても、メールが送信されないこと' do | |
assert_no_difference 'ActionMailer::Base.deliveries.size' do | |
change_user_email(@user) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment