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>2020-01-16 21:08:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 21:08:46 +0300
commitaa0f0e992153e84e1cdec8a1c7310d5eb93a9f8f (patch)
tree4a662bc77fb43e1d1deec78cc7a95d911c0da1c5 /spec/support/shared_examples/lib
parentd47f9d2304dbc3a23bba7fe7a5cd07218eeb41cd (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/lib')
-rw-r--r--spec/support/shared_examples/lib/sentry/client_shared_examples.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/support/shared_examples/lib/sentry/client_shared_examples.rb b/spec/support/shared_examples/lib/sentry/client_shared_examples.rb
index 76b71ebd3c5..4221708b55c 100644
--- a/spec/support/shared_examples/lib/sentry/client_shared_examples.rb
+++ b/spec/support/shared_examples/lib/sentry/client_shared_examples.rb
@@ -10,7 +10,7 @@ RSpec.shared_examples 'calls sentry api' do
end
# Requires sentry_api_url and subject to be defined
-RSpec.shared_examples 'no Sentry redirects' do
+RSpec.shared_examples 'no Sentry redirects' do |http_method|
let(:redirect_to) { 'https://redirected.example.com' }
let(:other_url) { 'https://other.example.org' }
@@ -19,6 +19,7 @@ RSpec.shared_examples 'no Sentry redirects' do
let!(:redirect_req_stub) do
stub_sentry_request(
sentry_api_url,
+ http_method || :get,
status: 302,
headers: { location: redirect_to }
)
@@ -31,7 +32,7 @@ RSpec.shared_examples 'no Sentry redirects' do
end
end
-RSpec.shared_examples 'maps Sentry exceptions' do
+RSpec.shared_examples 'maps Sentry exceptions' do |http_method|
exceptions = {
Gitlab::HTTP::Error => 'Error when connecting to Sentry',
Net::OpenTimeout => 'Connection to Sentry timed out',
@@ -44,7 +45,10 @@ RSpec.shared_examples 'maps Sentry exceptions' do
exceptions.each do |exception, message|
context "#{exception}" do
before do
- stub_request(:get, sentry_request_url).to_raise(exception)
+ stub_request(
+ http_method || :get,
+ sentry_request_url
+ ).to_raise(exception)
end
it do