diff options
Diffstat (limited to 'test/integration/api_test/api_test.rb')
-rw-r--r-- | test/integration/api_test/api_test.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/integration/api_test/api_test.rb b/test/integration/api_test/api_test.rb index 74e95d24d..69b6166a4 100644 --- a/test/integration/api_test/api_test.rb +++ b/test/integration/api_test/api_test.rb @@ -23,12 +23,13 @@ class Redmine::ApiTest::ApiTest < Redmine::ApiTest::Base def test_api_should_work_with_protect_from_forgery ActionController::Base.allow_forgery_protection = true assert_difference('User.count') do - post '/users.xml', { - :user => { - :login => 'foo', :firstname => 'Firstname', :lastname => 'Lastname', - :mail => 'foo@example.net', :password => 'secret123'} - }, - credentials('admin') + post '/users.xml', + :params => { + :user => { + :login => 'foo', :firstname => 'Firstname', :lastname => 'Lastname', + :mail => 'foo@example.net', :password => 'secret123'} + }, + :headers => credentials('admin') assert_response 201 end ensure @@ -36,17 +37,17 @@ class Redmine::ApiTest::ApiTest < Redmine::ApiTest::Base end def test_json_datetime_format - get '/users/1.json', {}, credentials('admin') + get '/users/1.json', :headers => credentials('admin') assert_include '"created_on":"2006-07-19T17:12:21Z"', response.body end def test_xml_datetime_format - get '/users/1.xml', {}, credentials('admin') + get '/users/1.xml', :headers => credentials('admin') assert_include '<created_on>2006-07-19T17:12:21Z</created_on>', response.body end def test_head_response_should_have_empty_body - put '/users/7.xml', {:user => {:login => 'foo'}}, credentials('admin') + put '/users/7.xml', :params => {:user => {:login => 'foo'}}, :headers => credentials('admin') assert_response :ok assert_equal '', response.body |