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/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb42
1 files changed, 24 insertions, 18 deletions
diff --git a/spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb b/spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb
index cef76bd4356..3119a03b1cb 100644
--- a/spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb
+++ b/spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb
@@ -31,29 +31,33 @@ RSpec.shared_examples 'a request using Gitlab::UrlBlocker' do
it 'raises error when it is a request that resolves to a local address' do
stub_full_request('https://example.com', method: http_method, ip_address: '172.16.0.0')
- expect { make_request('https://example.com') }
- .to raise_error(url_blocked_error_class,
- "URL is blocked: Requests to the local network are not allowed")
+ expect { make_request('https://example.com') }.to raise_error(
+ url_blocked_error_class,
+ "URL is blocked: Requests to the local network are not allowed"
+ )
end
it 'raises error when it is a request that resolves to a localhost address' do
stub_full_request('https://example.com', method: http_method, ip_address: '127.0.0.1')
- expect { make_request('https://example.com') }
- .to raise_error(url_blocked_error_class,
- "URL is blocked: Requests to localhost are not allowed")
+ expect { make_request('https://example.com') }.to raise_error(
+ url_blocked_error_class,
+ "URL is blocked: Requests to localhost are not allowed"
+ )
end
it 'raises error when it is a request to local address' do
- expect { make_request('http://172.16.0.0') }
- .to raise_error(url_blocked_error_class,
- "URL is blocked: Requests to the local network are not allowed")
+ expect { make_request('http://172.16.0.0') }.to raise_error(
+ url_blocked_error_class,
+ "URL is blocked: Requests to the local network are not allowed"
+ )
end
it 'raises error when it is a request to localhost address' do
- expect { make_request('http://127.0.0.1') }
- .to raise_error(url_blocked_error_class,
- "URL is blocked: Requests to localhost are not allowed")
+ expect { make_request('http://127.0.0.1') }.to raise_error(
+ url_blocked_error_class,
+ "URL is blocked: Requests to localhost are not allowed"
+ )
end
end
@@ -67,15 +71,17 @@ RSpec.shared_examples 'a request using Gitlab::UrlBlocker' do
end
it 'raises error when it is a request to local address' do
- expect { make_request('https://172.16.0.0:8080') }
- .to raise_error(url_blocked_error_class,
- "URL is blocked: Requests to the local network are not allowed")
+ expect { make_request('https://172.16.0.0:8080') }.to raise_error(
+ url_blocked_error_class,
+ "URL is blocked: Requests to the local network are not allowed"
+ )
end
it 'raises error when it is a request to localhost address' do
- expect { make_request('https://127.0.0.1:8080') }
- .to raise_error(url_blocked_error_class,
- "URL is blocked: Requests to localhost are not allowed")
+ expect { make_request('https://127.0.0.1:8080') }.to raise_error(
+ url_blocked_error_class,
+ "URL is blocked: Requests to localhost are not allowed"
+ )
end
end