diff options
author | Valery Sizov <valery@gitlab.com> | 2017-05-18 16:18:26 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-05-18 16:26:39 +0300 |
commit | ed86faebe1de0d7bb364341f8a36b4aac0757d0c (patch) | |
tree | d911db935b4f9f5f1bf942f3fc003f76a4f9e852 /spec/services/members | |
parent | 72119e7f38d5c50d2f1333adfedd6922d3e65ad1 (diff) |
Fix: Deleting an invited member causes 500 error
Diffstat (limited to 'spec/services/members')
-rw-r--r-- | spec/services/members/authorized_destroy_service_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/services/members/authorized_destroy_service_spec.rb b/spec/services/members/authorized_destroy_service_spec.rb index ab440d18e9f..8a6732faa19 100644 --- a/spec/services/members/authorized_destroy_service_spec.rb +++ b/spec/services/members/authorized_destroy_service_spec.rb @@ -10,6 +10,27 @@ describe Members::AuthorizedDestroyService, services: true do Issue.assigned_to(user).count + MergeRequest.assigned_to(user).count end + context 'Invited users' do + # Regression spec for issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/32504 + it 'destroys invited project member' do + project.team << [member_user, :developer] + + member = create :project_member, :invited, project: project + + expect { described_class.new(member, member_user).execute } + .to change { Member.count }.from(2).to(1) + end + + it 'destroys invited group member' do + group.add_developer(member_user) + + member = create :group_member, :invited, group: group + + expect { described_class.new(member, member_user).execute } + .to change { Member.count }.from(2).to(1) + end + end + context 'Group member' do it "unassigns issues and merge requests" do group.add_developer(member_user) |