2019-09-04 21:01:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::PhabricatorImport::ImportTasksWorker do
|
2019-09-04 21:01:54 +05:30
|
|
|
describe '#perform' do
|
|
|
|
it 'calls the correct importer' do
|
|
|
|
project = create(:project, :import_started, import_url: "https://the.phab.ulr")
|
|
|
|
fake_importer = instance_double(Gitlab::PhabricatorImport::Issues::Importer)
|
|
|
|
|
|
|
|
expect(Gitlab::PhabricatorImport::Issues::Importer).to receive(:new).with(project).and_return(fake_importer)
|
|
|
|
expect(fake_importer).to receive(:execute)
|
|
|
|
|
|
|
|
described_class.new.perform(project.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|