summaryrefslogtreecommitdiff
path: root/spec/workers/todos_destroyer
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2019-05-21 16:20:27 -0300
committerFelipe Artur <felipefac@gmail.com>2019-06-05 10:51:52 -0300
commitbe339468192c656bf9de0bb77d7e487f338902bf (patch)
tree81bb43511ab8d8cb7deedf844c8526f8d7b05051 /spec/workers/todos_destroyer
parentc9da437599027e9f2ef9f78a5167237f4b2a54dd (diff)
downloadgitlab-ce-be339468192c656bf9de0bb77d7e487f338902bf.tar.gz
Delete unauthorized Todos when project is privateissue_49897
Delete Todos for guest users when project visibility level is updated to private.
Diffstat (limited to 'spec/workers/todos_destroyer')
-rw-r--r--spec/workers/todos_destroyer/confidential_issue_worker_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/workers/todos_destroyer/confidential_issue_worker_spec.rb b/spec/workers/todos_destroyer/confidential_issue_worker_spec.rb
index 18876b71615..0907e2768ba 100644
--- a/spec/workers/todos_destroyer/confidential_issue_worker_spec.rb
+++ b/spec/workers/todos_destroyer/confidential_issue_worker_spec.rb
@@ -3,12 +3,19 @@
require 'spec_helper'
describe TodosDestroyer::ConfidentialIssueWorker do
- it "calls the Todos::Destroy::ConfidentialIssueService with the params it was given" do
- service = double
+ let(:service) { double }
- expect(::Todos::Destroy::ConfidentialIssueService).to receive(:new).with(100).and_return(service)
+ it "calls the Todos::Destroy::ConfidentialIssueService with issue_id parameter" do
+ expect(::Todos::Destroy::ConfidentialIssueService).to receive(:new).with(issue_id: 100, project_id: nil).and_return(service)
expect(service).to receive(:execute)
described_class.new.perform(100)
end
+
+ it "calls the Todos::Destroy::ConfidentialIssueService with project_id parameter" do
+ expect(::Todos::Destroy::ConfidentialIssueService).to receive(:new).with(issue_id: nil, project_id: 100).and_return(service)
+ expect(service).to receive(:execute)
+
+ described_class.new.perform(nil, 100)
+ end
end