Mercurial > hg > soundsoftware-site
diff test/integration/api_test/.svn/text-base/users_test.rb.svn-base @ 128:07fa8a8b56a8
Update to Redmine trunk rev 4732
author | Chris Cannam |
---|---|
date | Wed, 19 Jan 2011 15:04:22 +0000 |
parents | 8661b858af72 |
children | cbce1fd3b1b7 |
line wrap: on
line diff
--- a/test/integration/api_test/.svn/text-base/users_test.rb.svn-base Thu Jan 13 14:12:06 2011 +0000 +++ b/test/integration/api_test/.svn/text-base/users_test.rb.svn-base Wed Jan 19 15:04:22 2011 +0000 @@ -245,26 +245,36 @@ end end end + end - context "DELETE /users/2" do - context ".xml" do - should "not be allowed" do - assert_no_difference('User.count') do - delete '/users/2.xml' - end + context "DELETE /users/2" do + context ".xml" do + should_allow_api_authentication(:delete, + '/users/2.xml', + {}, + {:success_code => :ok}) + + should "delete user" do + assert_difference('User.count', -1) do + delete '/users/2.xml', {}, :authorization => credentials('admin') + end + + assert_response :ok + end + end + + context ".json" do + should_allow_api_authentication(:delete, + '/users/2.xml', + {}, + {:success_code => :ok}) - assert_response :method_not_allowed + should "delete user" do + assert_difference('User.count', -1) do + delete '/users/2.json', {}, :authorization => credentials('admin') end - end - - context ".json" do - should "not be allowed" do - assert_no_difference('User.count') do - delete '/users/2.json' - end - - assert_response :method_not_allowed - end + + assert_response :ok end end end