]> source.dussan.org Git - redmine.git/commitdiff
Additional test for memberships API.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 19 Apr 2012 08:18:27 +0000 (08:18 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 19 Apr 2012 08:18:27 +0000 (08:18 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9447 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/api_test/memberships_test.rb

index ada24208b50045c1bbdb83869eaffe3b8a066665..dcda2c4dd7af6ec6f12901ac757051c5f982a490 100644 (file)
@@ -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