summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-19 08:18:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-19 08:18:27 +0000
commit67f90df175babcb4501daf7d97472c49db777588 (patch)
treeaf10a93caf1fa0eb47a35717205700d42bcf2d60 /test/integration
parentc88fbfbdadfa104fbd0859cc7a82cdf8394c81fa (diff)
downloadredmine-67f90df175babcb4501daf7d97472c49db777588.tar.gz
redmine-67f90df175babcb4501daf7d97472c49db777588.zip
Additional test for memberships API.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9447 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/memberships_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/integration/api_test/memberships_test.rb b/test/integration/api_test/memberships_test.rb
index ada24208b..dcda2c4dd 100644
--- a/test/integration/api_test/memberships_test.rb
+++ b/test/integration/api_test/memberships_test.rb
@@ -161,6 +161,14 @@ class ApiTest::MembershipsTest < ActionController::IntegrationTest
member = Member.find(2)
assert_equal [1,2], member.role_ids.sort
end
+
+ should "return errors on failure" do
+ put '/memberships/2.xml', {:membership => {:user_id => 3, :role_ids => [99]}}, credentials('jsmith')
+
+ assert_response :unprocessable_entity
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'errors', :child => {:tag => 'error', :content => "member_roles is invalid"}
+ end
end
end