Send an email to the user when an administrator activates a registered user (#2656).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2484 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-02-20 17:04:47 +00:00
parent 24ee6b9a1b
commit 04c428e059
5 changed files with 34 additions and 1 deletions
+16
View File
@@ -126,6 +126,22 @@ class UsersControllerTest < Test::Unit::TestCase
assert_equal 2, Member.find(1).role_id
end
def test_edit_with_activation_should_send_a_notification
u = User.new(:firstname => 'Foo', :lastname => 'Bar', :mail => 'foo.bar@somenet.foo', :language => 'fr')
u.login = 'foo'
u.status = User::STATUS_REGISTERED
u.save!
ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1'
post :edit, :id => u.id, :user => {:status => User::STATUS_ACTIVE}
assert u.reload.active?
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal ['foo.bar@somenet.foo'], mail.bcc
assert mail.body.include?(ll('fr', :notice_account_activated))
end
def test_destroy_membership
assert_routing(
#TODO: use DELETE method on user_membership_path, modify form