BigW Consortium Gitlab

repository_import_worker_spec.rb 495 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
require 'spec_helper'

describe RepositoryImportWorker do
  let(:project) { create(:project) }

  subject { described_class.new }

  describe '#perform' do
    it 'imports a project' do
      expect_any_instance_of(Projects::ImportService).to receive(:execute).
        and_return({ status: :ok })

      expect_any_instance_of(Repository).to receive(:expire_emptiness_caches)
      expect_any_instance_of(Project).to receive(:import_finish)

      subject.perform(project.id)
    end
  end
end