summaryrefslogtreecommitdiff
path: root/spec/workers/repository_import_worker_spec.rb
blob: 6739063543b2016800b19476acbf2c613325672a (plain)
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