diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 03:09:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 03:09:12 +0300 |
commit | 0b881f91159cc97ccb7328a2e52977a60ea83fbe (patch) | |
tree | d6b683cb935112aee47121f46e3c5dc84de24f2c /spec/support | |
parent | 7671216b60e2796a050358ff808b4a0c2de3d22f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/metrics_dashboard_url_helpers.rb | 16 |
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 |