summaryrefslogtreecommitdiffstats
path: root/test/functional/my_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-12 15:13:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-12 15:13:34 +0000
commit0a2ec6ef0472fc0a14fe5793408c0546ebf39e4d (patch)
treeb634c4b758b9f958e23ae968bdd481e78306f803 /test/functional/my_controller_test.rb
parent87ae744dce313076211ff472eb95edb65a048c82 (diff)
downloadredmine-0a2ec6ef0472fc0a14fe5793408c0546ebf39e4d.tar.gz
redmine-0a2ec6ef0472fc0a14fe5793408c0546ebf39e4d.zip
Extracts user groups assignment from controller.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4499 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/my_controller_test.rb')
-rw-r--r--test/functional/my_controller_test.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb
index 3fefa0675..69a5b3e13 100644
--- a/test/functional/my_controller_test.rb
+++ b/test/functional/my_controller_test.rb
@@ -64,17 +64,24 @@ class MyControllerTest < ActionController::TestCase
end
def test_update_account
- post :account, :user => {:firstname => "Joe",
- :login => "root",
- :admin => 1,
- :custom_field_values => {"4" => "0100562500"}}
+ post :account,
+ :user => {
+ :firstname => "Joe",
+ :login => "root",
+ :admin => 1,
+ :group_ids => ['10'],
+ :custom_field_values => {"4" => "0100562500"}
+ }
+
assert_redirected_to '/my/account'
user = User.find(2)
assert_equal user, assigns(:user)
assert_equal "Joe", user.firstname
assert_equal "jsmith", user.login
assert_equal "0100562500", user.custom_value_for(4).value
+ # ignored
assert !user.admin?
+ assert user.groups.empty?
end
def test_change_password