Extracts user groups assignment from controller.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4499 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-12-12 15:13:34 +00:00
parent 87ae744dce
commit 0a2ec6ef04
4 changed files with 22 additions and 6 deletions

View File

@@ -183,6 +183,13 @@ class UsersControllerTest < ActionController::TestCase
assert ActionMailer::Base.deliveries.empty?
end
def test_update_with_group_ids_should_assign_groups
put :update, :id => 2, :user => {:group_ids => ['10']}
user = User.find(2)
assert_equal [10], user.group_ids
end
def test_update_with_activation_should_send_a_notification
u = User.new(:firstname => 'Foo', :lastname => 'Bar', :mail => 'foo.bar@somenet.foo', :language => 'fr')
u.login = 'foo'