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

project_update_repository_storage_worker_spec.rb « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aa6545f7f891da58f56887dfaa63c9e5298d5337 (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
# frozen_string_literal: true

require 'spec_helper'

describe ProjectUpdateRepositoryStorageWorker do
  let(:project) { create(:project, :repository) }

  subject { described_class.new }

  describe "#perform" do
    it "calls the update repository storage service" do
      expect_any_instance_of(Projects::UpdateRepositoryStorageService)
        .to receive(:execute).with('new_storage')

      subject.perform(project.id, 'new_storage')
    end

    it 'catches and logs RepositoryAlreadyMoved' do
      expect(Rails.logger).to receive(:info).with(/repository already moved/)

      expect { subject.perform(project.id, project.repository_storage) }.not_to raise_error
    end
  end
end