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/integration/api_test | |
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/integration/api_test')
-rw-r--r-- | test/integration/api_test/users_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/integration/api_test/users_test.rb b/test/integration/api_test/users_test.rb index b1687b7ed..e1eb7a237 100644 --- a/test/integration/api_test/users_test.rb +++ b/test/integration/api_test/users_test.rb @@ -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 |