diff options
Diffstat (limited to 'spec/workers/todos_destroyer/confidential_issue_worker_spec.rb')
-rw-r--r-- | spec/workers/todos_destroyer/confidential_issue_worker_spec.rb | 15 |
1 files changed, 12 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 9d7c0b8f560..0907e2768ba 100644 --- a/spec/workers/todos_destroyer/confidential_issue_worker_spec.rb +++ b/spec/workers/todos_destroyer/confidential_issue_worker_spec.rb @@ -1,12 +1,21 @@ +# frozen_string_literal: true + 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 |