summaryrefslogtreecommitdiff
path: root/spec/migrations/rename_more_reserved_project_names_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/migrations/rename_more_reserved_project_names_spec.rb')
-rw-r--r--spec/migrations/rename_more_reserved_project_names_spec.rb57
1 files changed, 0 insertions, 57 deletions
diff --git a/spec/migrations/rename_more_reserved_project_names_spec.rb b/spec/migrations/rename_more_reserved_project_names_spec.rb
deleted file mode 100644
index 80ae209e9d1..00000000000
--- a/spec/migrations/rename_more_reserved_project_names_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# encoding: utf-8
-
-require 'spec_helper'
-require Rails.root.join('db', 'post_migrate', '20170313133418_rename_more_reserved_project_names.rb')
-
-# This migration uses multiple threads, and thus different transactions. This
-# means data created in this spec may not be visible to some threads. To work
-# around this we use the DELETE cleaning strategy.
-describe RenameMoreReservedProjectNames, :delete do
- let(:migration) { described_class.new }
- let!(:project) { create(:project) } # rubocop:disable RSpec/FactoriesInMigrationSpecs
-
- before do
- project.path = 'artifacts'
- project.save!(validate: false)
- end
-
- describe '#up' do
- context 'when project repository exists' do
- before do
- project.create_repository
- end
-
- context 'when no exception is raised' do
- it 'renames project with reserved names' do
- migration.up
-
- expect(project.reload.path).to eq('artifacts0')
- end
- end
-
- context 'when exception is raised during rename' do
- before do
- service = instance_double('service')
-
- allow(service)
- .to receive(:execute)
- .and_raise(Projects::AfterRenameService::RenameFailedError)
-
- expect(migration)
- .to receive(:after_rename_service)
- .and_return(service)
- end
-
- it 'captures exception from project rename' do
- expect { migration.up }.not_to raise_error
- end
- end
- end
-
- context 'when project repository does not exist' do
- it 'does not raise error' do
- expect { migration.up }.not_to raise_error
- end
- end
- end
-end