Commit 64768cd4bf4af2298026b07624ffc983be3ce8a7
Committed by
Luciano Prestes
1 parent
6dbf5661
Exists in
merge_deactive_and_ban
deactive_and_active_profile: Add tests
(ActionItem3287) Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com>
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
test/unit/user_mailer_test.rb
| ... | ... | @@ -18,6 +18,19 @@ class UserMailerTest < ActiveSupport::TestCase |
| 18 | 18 | end |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | + should 'deliver deactivation email' do | |
| 22 | + assert_difference 'ActionMailer::Base.deliveries.size' do | |
| 23 | + u = create_user('some-user') | |
| 24 | + UserMailer.ban_user_mail_with_reason(u,"reason").deliver | |
| 25 | + end | |
| 26 | + end | |
| 27 | + | |
| 28 | + should 'verify deactivation email' do | |
| 29 | + u = create_user('some-user') | |
| 30 | + email = UserMailer.ban_user_mail_with_reason(u,"you lose").deliver | |
| 31 | + assert_match("[#{u.environment}] User deactivated", email.subject) | |
| 32 | + end | |
| 33 | + | |
| 21 | 34 | private |
| 22 | 35 | |
| 23 | 36 | def read_fixture(action) | ... | ... |