summaryrefslogtreecommitdiff
path: root/spec/workers/todos_destroyer/confidential_issue_worker_spec.rb
blob: 0907e2768baaac069471ab2f693b8624238129c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

describe TodosDestroyer::ConfidentialIssueWorker do
  let(:service) { double }

  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