@@ -89,6 +89,16 class Redmine::ApiTest::MembershipsTest < Redmine::ApiTest::Base | |||||
89 | end |
|
89 | end | |
90 | end |
|
90 | end | |
91 |
|
91 | |||
|
92 | test "POST /projects/:project_id/memberships.xml should create the group membership" do | |||
|
93 | group = Group.find(11) | |||
|
94 | ||||
|
95 | assert_difference 'Member.count', 1 + group.users.count do | |||
|
96 | post '/projects/1/memberships.xml', {:membership => {:user_id => 11, :role_ids => [2,3]}}, credentials('jsmith') | |||
|
97 | ||||
|
98 | assert_response :created | |||
|
99 | end | |||
|
100 | end | |||
|
101 | ||||
92 | test "POST /projects/:project_id/memberships.xml with invalid parameters should return errors" do |
|
102 | test "POST /projects/:project_id/memberships.xml with invalid parameters should return errors" do | |
93 | assert_no_difference 'Member.count' do |
|
103 | assert_no_difference 'Member.count' do | |
94 | post '/projects/1/memberships.xml', {:membership => {:role_ids => [2,3]}}, credentials('jsmith') |
|
104 | post '/projects/1/memberships.xml', {:membership => {:role_ids => [2,3]}}, credentials('jsmith') |
General Comments 0
You need to be logged in to leave comments.
Login now