diff options
author | Felipe Artur <felipefac@gmail.com> | 2019-05-21 16:20:27 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2019-06-05 10:51:52 -0300 |
commit | be339468192c656bf9de0bb77d7e487f338902bf (patch) | |
tree | 81bb43511ab8d8cb7deedf844c8526f8d7b05051 /spec/workers/todos_destroyer | |
parent | c9da437599027e9f2ef9f78a5167237f4b2a54dd (diff) | |
download | gitlab-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.rb | 13 |
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 |