2019-03-30 07:15:48 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-07-16 18:30:17 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-26 09:08:59 +00:00
|
|
|
RSpec.describe TodosDestroyer::ConfidentialIssueWorker do
|
2019-05-21 19:20:27 +00:00
|
|
|
let(:service) { double }
|
2018-07-16 18:30:17 +00:00
|
|
|
|
2019-05-21 19:20:27 +00:00
|
|
|
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)
|
2018-07-16 18:30:17 +00:00
|
|
|
expect(service).to receive(:execute)
|
|
|
|
|
|
|
|
described_class.new.perform(100)
|
|
|
|
end
|
2019-05-21 19:20:27 +00:00
|
|
|
|
|
|
|
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
|
2018-07-16 18:30:17 +00:00
|
|
|
end
|