diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 00:08:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 00:08:01 +0300 |
commit | 561e1b470f0a99fe6304c8f197348c47a637d594 (patch) | |
tree | 6b361b6b0b412b70450aca167079c50a13bd88d8 /spec/workers/project_update_repository_storage_worker_spec.rb | |
parent | 7b52c7cb634ef7047d30b0337fe477bcdcedf41d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/project_update_repository_storage_worker_spec.rb')
-rw-r--r-- | spec/workers/project_update_repository_storage_worker_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/workers/project_update_repository_storage_worker_spec.rb b/spec/workers/project_update_repository_storage_worker_spec.rb new file mode 100644 index 00000000000..aa6545f7f89 --- /dev/null +++ b/spec/workers/project_update_repository_storage_worker_spec.rb @@ -0,0 +1,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 |