Welcome to mirror list, hosted at ThFree Co, Russian Federation.

import_lfs_objects_worker_spec.rb « stage « bitbucket_import « gitlab « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a645c9e698d858fa4357e8a9efa9c584217eee26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::BitbucketImport::Stage::ImportLfsObjectsWorker, feature_category: :importers do
  let_it_be(:project) { create(:project, :import_started) }

  subject(:worker) { described_class.new }

  it_behaves_like Gitlab::BitbucketImport::StageMethods

  describe '#perform' do
    context 'when the import succeeds' do
      before do
        allow_next_instance_of(Gitlab::BitbucketImport::Importers::LfsObjectsImporter) do |importer|
          allow(importer).to receive(:execute).and_return(Gitlab::JobWaiter.new(2, '123'))
        end
      end

      it 'schedules the next stage' do
        expect(Gitlab::BitbucketImport::AdvanceStageWorker).to receive(:perform_async)
          .with(project.id, { '123' => 2 }, :finish)

        worker.perform(project.id)
      end
    end
  end
end