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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-20 11:43:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-20 11:43:02 +0300
commitd9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch)
tree2341ef426af70ad1e289c38036737e04b0aa5007 /spec/lib/bulk_imports/clients/http_spec.rb
parentd6e514dd13db8947884cd58fe2a9c2a063400a9b (diff)
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'spec/lib/bulk_imports/clients/http_spec.rb')
-rw-r--r--spec/lib/bulk_imports/clients/http_spec.rb34
1 files changed, 30 insertions, 4 deletions
diff --git a/spec/lib/bulk_imports/clients/http_spec.rb b/spec/lib/bulk_imports/clients/http_spec.rb
index c36cb80851a..623f9aa453a 100644
--- a/spec/lib/bulk_imports/clients/http_spec.rb
+++ b/spec/lib/bulk_imports/clients/http_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe BulkImports::Clients::HTTP do
let(:url) { 'http://gitlab.example' }
let(:token) { 'token' }
let(:resource) { 'resource' }
- let(:version) { "#{BulkImport::MINIMUM_GITLAB_MAJOR_VERSION}.0.0" }
+ let(:version) { "#{BulkImport::MIN_MAJOR_VERSION}.0.0" }
let(:response_double) { double(code: 200, success?: true, parsed_response: {}) }
let(:version_response) { double(code: 200, success?: true, parsed_response: { 'version' => version }) }
@@ -32,7 +32,7 @@ RSpec.describe BulkImports::Clients::HTTP do
it 'raises BulkImports::Error' do
allow(Gitlab::HTTP).to receive(method).and_raise(Errno::ECONNREFUSED)
- expect { subject.public_send(method, resource) }.to raise_exception(BulkImports::Error)
+ expect { subject.public_send(method, resource) }.to raise_exception(BulkImports::NetworkError)
end
end
@@ -42,7 +42,7 @@ RSpec.describe BulkImports::Clients::HTTP do
allow(Gitlab::HTTP).to receive(method).and_return(response_double)
- expect { subject.public_send(method, resource) }.to raise_exception(BulkImports::Error)
+ expect { subject.public_send(method, resource) }.to raise_exception(BulkImports::NetworkError)
end
end
end
@@ -176,11 +176,37 @@ RSpec.describe BulkImports::Clients::HTTP do
end
end
+ describe '#instance_version' do
+ it 'returns version as an instance of Gitlab::VersionInfo' do
+ expect(subject.instance_version).to eq(Gitlab::VersionInfo.parse(version))
+ end
+ end
+
+ describe '#compatible_for_project_migration?' do
+ context 'when instance version is lower the the expected minimum' do
+ it 'returns false' do
+ expect(subject.compatible_for_project_migration?).to be false
+ end
+ end
+
+ context 'when instance version is at least the expected minimum' do
+ let(:version) { "14.4.4" }
+
+ it 'returns true' do
+ expect(subject.compatible_for_project_migration?).to be true
+ end
+ end
+ end
+
context 'when source instance is incompatible' do
let(:version) { '13.0.0' }
it 'raises an error' do
- expect { subject.get(resource) }.to raise_error(::BulkImports::Error, "Unsupported GitLab Version. Minimum Supported Gitlab Version #{BulkImport::MINIMUM_GITLAB_MAJOR_VERSION}.")
+ expect { subject.get(resource) }
+ .to raise_error(
+ ::BulkImports::Error,
+ "Unsupported GitLab Version. Minimum Supported Gitlab Version #{BulkImport::MIN_MAJOR_VERSION}."
+ )
end
end