diff options
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/api_test/users_test.rb | 17 | ||||
-rw-r--r-- | test/integration/routing_test.rb | 1 |
2 files changed, 18 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 diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 01462a74e..78512b04f 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -286,6 +286,7 @@ class RoutingTest < ActionController::IntegrationTest context "users" do should_route :get, "/users", :controller => 'users', :action => 'index' should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' + should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current' should_route :get, "/users/new", :controller => 'users', :action => 'new' should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership' |