diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-20 17:45:09 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-20 17:45:09 +0000 |
commit | 599bc450730b91769f878d38b76110ce5c8fbca7 (patch) | |
tree | 1626b75596f1fd3a52cb54ce0e6008214cedb3e2 /test/functional/users_controller_test.rb | |
parent | 84dd413f22b9a3900ceaa33d63758f285908ecb1 (diff) | |
download | redmine-599bc450730b91769f878d38b76110ce5c8fbca7.tar.gz redmine-599bc450730b91769f878d38b76110ce5c8fbca7.zip |
Adds support for requesting information about current user using /users/current (#7141).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4544 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/users_controller_test.rb')
-rw-r--r-- | test/functional/users_controller_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index 0272e1fdb..8aa311ebb 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -120,6 +120,20 @@ class UsersControllerTest < ActionController::TestCase assert project_ids.include?(2) #private project admin can see end + def test_show_current_should_require_authentication + @request.session[:user_id] = nil + get :show, :id => 'current' + assert_response 302 + end + + def test_show_current + @request.session[:user_id] = 2 + get :show, :id => 'current' + assert_response :success + assert_template 'show' + assert_equal User.find(2), assigns(:user) + end + def test_new get :new |