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:
Diffstat (limited to 'spec/lib/bulk_imports/clients/http_spec.rb')
-rw-r--r--spec/lib/bulk_imports/clients/http_spec.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/lib/bulk_imports/clients/http_spec.rb b/spec/lib/bulk_imports/clients/http_spec.rb
index aff049408e2..bf1bfb77b26 100644
--- a/spec/lib/bulk_imports/clients/http_spec.rb
+++ b/spec/lib/bulk_imports/clients/http_spec.rb
@@ -33,11 +33,17 @@ RSpec.describe BulkImports::Clients::HTTP, feature_category: :importers do
end
context 'error handling' do
- context 'when error occurred' do
- it 'raises BulkImports::NetworkError' do
- allow(Gitlab::HTTP).to receive(method).and_raise(Errno::ECONNREFUSED)
+ context 'when any known HTTP error occurs' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:exception_class) { Gitlab::HTTP::HTTP_ERRORS }
+
+ with_them do
+ it 'raises BulkImports::NetworkError' do
+ allow(Gitlab::HTTP).to receive(method).and_raise(exception_class)
- expect { subject.public_send(method, resource) }.to raise_exception(BulkImports::NetworkError)
+ expect { subject.public_send(method, resource) }.to raise_exception(BulkImports::NetworkError)
+ end
end
end