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
This commit is contained in:
Jean-Philippe Lang
2010-12-20 17:45:09 +00:00
parent 84dd413f22
commit 599bc45073
4 changed files with 46 additions and 10 deletions
+14
View File
@@ -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