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

View File

@@ -50,6 +50,23 @@ class ApiTest::UsersTest < ActionController::IntegrationTest
end
end
end
context "GET /users/current" do
context ".xml" do
should "require authentication" do
get '/users/current.xml'
assert_response 401
end
should "return current user" do
get '/users/current.xml', {}, :authorization => credentials('jsmith')
assert_tag :tag => 'user',
:child => {:tag => 'id', :content => '2'}
end
end
end
context "POST /users" do
context "with valid parameters" do