summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-13 10:05:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-13 10:05:43 +0000
commiteaab2ede76c9bb3d1ed89af87029316a32e9968f (patch)
tree6591ff07b3e4560aa47d09d541c8a3ac3386b70e /test/integration/api_test
parentabf988ad69cc4e93419d43f1b86d463e16af594a (diff)
downloadredmine-eaab2ede76c9bb3d1ed89af87029316a32e9968f.tar.gz
redmine-eaab2ede76c9bb3d1ed89af87029316a32e9968f.zip
Makes projects API return XML description when creating a project (#6874).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4397 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/issues_test.rb4
-rw-r--r--test/integration/api_test/projects_test.rb7
2 files changed, 9 insertions, 2 deletions
diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb
index 60ee66bb9..1c1f3f8b7 100644
--- a/test/integration/api_test/issues_test.rb
+++ b/test/integration/api_test/issues_test.rb
@@ -106,6 +106,10 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest
assert_equal 2, issue.tracker_id
assert_equal 3, issue.status_id
assert_equal 'API test', issue.subject
+
+ assert_response :created
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'issue', :child => {:tag => 'id', :content => issue.id.to_s}
end
end
diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb
index de84daa08..21b080a13 100644
--- a/test/integration/api_test/projects_test.rb
+++ b/test/integration/api_test/projects_test.rb
@@ -52,12 +52,15 @@ class ApiTest::ProjectsTest < ActionController::IntegrationTest
assert_difference 'Project.count' do
post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
end
- assert_response :created
- assert_equal 'application/xml', @response.content_type
+
project = Project.first(:order => 'id DESC')
attributes.each do |attribute, value|
assert_equal value, project.send(attribute)
end
+
+ assert_response :created
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'project', :child => {:tag => 'id', :content => project.id.to_s}
end
def test_create_failure