diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-04 09:46:50 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-04 09:46:50 +0000 |
commit | 8b678837a353747f6f4fcce343c603daf1e07fbe (patch) | |
tree | 4046e77a90b1fac03026417052c25b7e5bee6efe /test/integration | |
parent | 8b998ec05ba92082beb8265f5403bc0ec945a0ed (diff) | |
download | redmine-8b678837a353747f6f4fcce343c603daf1e07fbe.tar.gz redmine-8b678837a353747f6f4fcce343c603daf1e07fbe.zip |
Adds a test for adding a group membership with the REST API (#17904).
git-svn-id: http://svn.redmine.org/redmine/trunk@13426 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/api_test/memberships_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/integration/api_test/memberships_test.rb b/test/integration/api_test/memberships_test.rb index 544626592..7ad0c5790 100644 --- a/test/integration/api_test/memberships_test.rb +++ b/test/integration/api_test/memberships_test.rb @@ -89,6 +89,16 @@ class Redmine::ApiTest::MembershipsTest < Redmine::ApiTest::Base end end + test "POST /projects/:project_id/memberships.xml should create the group membership" do + group = Group.find(11) + + assert_difference 'Member.count', 1 + group.users.count do + post '/projects/1/memberships.xml', {:membership => {:user_id => 11, :role_ids => [2,3]}}, credentials('jsmith') + + assert_response :created + end + end + test "POST /projects/:project_id/memberships.xml with invalid parameters should return errors" do assert_no_difference 'Member.count' do post '/projects/1/memberships.xml', {:membership => {:role_ids => [2,3]}}, credentials('jsmith') |