diff options
author | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-16 21:30:17 +0300 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-30 14:29:18 +0300 |
commit | 501fb04ec65cadcd7dddc6376546db8d8f7f123c (patch) | |
tree | 9f984fc2b284239f03f10fa0daa1127c20b3fc59 /spec/services/members | |
parent | 2ca8219a20f16636b7a0ffa899a1a04ab8e84782 (diff) |
Delete todos when users loses target read permissions
Diffstat (limited to 'spec/services/members')
-rw-r--r-- | spec/services/members/destroy_service_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/services/members/destroy_service_spec.rb b/spec/services/members/destroy_service_spec.rb index ef47b0a450b..0a5220c7c61 100644 --- a/spec/services/members/destroy_service_spec.rb +++ b/spec/services/members/destroy_service_spec.rb @@ -20,6 +20,11 @@ describe Members::DestroyService do end shared_examples 'a service destroying a member' do + before do + type = member.is_a?(GroupMember) ? 'Group' : 'Project' + expect(TodosDestroyer::EntityLeaveWorker).to receive(:perform_in).with(1.hour, member.user_id, member.source_id, type) + end + it 'destroys the member' do expect { described_class.new(current_user).execute(member, opts) }.to change { member.source.members_and_requesters.count }.by(-1) end |