2019-07-07 11:18:12 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe TodosDestroyer::ConfidentialIssueWorker do
|
2019-09-04 21:01:54 +05:30
|
|
|
let(:service) { double }
|
2018-11-18 11:00:15 +05:30
|
|
|
|
2019-09-04 21:01:54 +05:30
|
|
|
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-11-18 11:00:15 +05:30
|
|
|
expect(service).to receive(:execute)
|
|
|
|
|
|
|
|
described_class.new.perform(100)
|
|
|
|
end
|
2019-09-04 21:01:54 +05:30
|
|
|
|
|
|
|
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-11-18 11:00:15 +05:30
|
|
|
end
|