mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 22:05:56 +01:00
use with_settings at UsersControllerTest#test_update_with_activation_should_send_a_notification
git-svn-id: http://svn.redmine.org/redmine/trunk@20388 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -544,17 +544,21 @@ class UsersControllerTest < Redmine::ControllerTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_update_with_activation_should_send_a_notification
|
def test_update_with_activation_should_send_a_notification
|
||||||
u = User.new(:firstname => 'Foo', :lastname => 'Bar', :mail => 'foo.bar@somenet.foo', :language => 'fr')
|
u = User.new(:firstname => 'Foo', :lastname => 'Bar',
|
||||||
|
:mail => 'foo.bar@somenet.foo', :language => 'fr')
|
||||||
u.login = 'foo'
|
u.login = 'foo'
|
||||||
u.status = User::STATUS_REGISTERED
|
u.status = User::STATUS_REGISTERED
|
||||||
u.save!
|
u.save!
|
||||||
ActionMailer::Base.deliveries.clear
|
ActionMailer::Base.deliveries.clear
|
||||||
Setting.bcc_recipients = '1'
|
with_settings :bcc_recipients => '1' do
|
||||||
|
put(
|
||||||
put :update, :params => {
|
:update,
|
||||||
:id => u.id,
|
:params => {
|
||||||
:user => {:status => User::STATUS_ACTIVE}
|
:id => u.id,
|
||||||
}
|
:user => {:status => User::STATUS_ACTIVE}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end
|
||||||
assert u.reload.active?
|
assert u.reload.active?
|
||||||
mail = ActionMailer::Base.deliveries.last
|
mail = ActionMailer::Base.deliveries.last
|
||||||
assert_not_nil mail
|
assert_not_nil mail
|
||||||
|
|||||||
Reference in New Issue
Block a user