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-02-25 03:09:12 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 03:09:12 +0300
commit0b881f91159cc97ccb7328a2e52977a60ea83fbe (patch)
treed6b683cb935112aee47121f46e3c5dc84de24f2c /spec/support/helpers
parent7671216b60e2796a050358ff808b4a0c2de3d22f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers')
-rw-r--r--spec/support/helpers/metrics_dashboard_url_helpers.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/support/helpers/metrics_dashboard_url_helpers.rb b/spec/support/helpers/metrics_dashboard_url_helpers.rb
new file mode 100644
index 00000000000..5809f152e3e
--- /dev/null
+++ b/spec/support/helpers/metrics_dashboard_url_helpers.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module MetricsDashboardUrlHelpers
+ # Using the url_helpers available in the test suite uses
+ # the sample host, but the urls generated may need to
+ # point to the configured host in the :js trait
+ def urls
+ ::Gitlab::Routing.url_helpers
+ end
+
+ def clear_host_from_memoized_variables
+ [:metrics_regex, :grafana_regex, :cluster_metrics, :alerts_regex].each do |method_name|
+ Gitlab::Metrics::Dashboard::Url.clear_memoization(method_name)
+ end
+ end
+end