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:
authorTristan Read <tread@gitlab.com>2019-07-26 04:41:54 +0300
committerThong Kuah <tkuah@gitlab.com>2019-07-26 04:41:54 +0300
commitca9b067e3444b90fd5261d30a735b2a10586336f (patch)
tree086ebf0a284ce3d4e031da5205b9bb63ed38418f /spec/support
parent8b7030751cafea606617dfdcfff0ce70d11238f1 (diff)
Feature test for gfm embedding metrics
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/helpers/prometheus_helpers.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/helpers/prometheus_helpers.rb b/spec/support/helpers/prometheus_helpers.rb
index 4d39d9df494..7c03746a395 100644
--- a/spec/support/helpers/prometheus_helpers.rb
+++ b/spec/support/helpers/prometheus_helpers.rb
@@ -76,6 +76,14 @@ module PrometheusHelpers
WebMock.stub_request(:any, /prometheus.example.com/)
end
+ def stub_any_prometheus_request_with_response(status: 200, headers: {}, body: nil)
+ stub_any_prometheus_request.to_return({
+ status: status,
+ headers: { 'Content-Type' => 'application/json' }.merge(headers),
+ body: body || prometheus_values_body.to_json
+ })
+ end
+
def stub_all_prometheus_requests(environment_slug, body: nil, status: 200)
stub_prometheus_request(
prometheus_query_with_time_url(prometheus_memory_query(environment_slug), Time.now.utc),