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/issues/update_service_spec.rb | |
parent | 2ca8219a20f16636b7a0ffa899a1a04ab8e84782 (diff) |
Delete todos when users loses target read permissions
Diffstat (limited to 'spec/services/issues/update_service_spec.rb')
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index fa98d05c61b..5bcfef46b75 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -55,6 +55,8 @@ describe Issues::UpdateService, :mailer do end it 'updates the issue with the given params' do + expect(TodosDestroyer::ConfidentialIssueWorker).not_to receive(:perform_in) + update_issue(opts) expect(issue).to be_valid @@ -74,6 +76,21 @@ describe Issues::UpdateService, :mailer do .to change { project.open_issues_count }.from(1).to(0) end + it 'enqueues ConfidentialIssueWorker when an issue is made confidential' do + expect(TodosDestroyer::ConfidentialIssueWorker).to receive(:perform_in).with(1.hour, issue.id) + + update_issue(confidential: true) + end + + it 'does not enqueue ConfidentialIssueWorker when an issue is made non confidential' do + # set confidentiality to true before the actual update + issue.update!(confidential: true) + + expect(TodosDestroyer::ConfidentialIssueWorker).not_to receive(:perform_in) + + update_issue(confidential: false) + end + it 'updates open issue counter for assignees when issue is reassigned' do update_issue(assignee_ids: [user2.id]) |