summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-15 09:09:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-15 09:09:34 +0000
commita898b6057ecf9ab635c45217568d44eab5c32ec0 (patch)
treecaf9dbacd3058a6714478ea16b9bd54b2ac463ce /spec/helpers
parent7d5d23819bd51063dc641c29bff7b334cea83d84 (diff)
downloadgitlab-ce-a898b6057ecf9ab635c45217568d44eab5c32ec0.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/environments_helper_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/helpers/environments_helper_spec.rb b/spec/helpers/environments_helper_spec.rb
index 33dca04fc57..90d6096654e 100644
--- a/spec/helpers/environments_helper_spec.rb
+++ b/spec/helpers/environments_helper_spec.rb
@@ -95,6 +95,30 @@ RSpec.describe EnvironmentsHelper do
it { is_expected.to include('environment-state' => 'stopped') }
end
+
+ context 'when request is from project scoped metrics path' do
+ let(:request) { double('request', path: path) }
+
+ before do
+ allow(helper).to receive(:request).and_return(request)
+ end
+
+ context '/:namespace/:project/-/metrics' do
+ let(:path) { project_metrics_dashboard_path(project) }
+
+ it 'uses correct path for metrics-dashboard-base-path' do
+ expect(metrics_data['metrics-dashboard-base-path']).to eq(project_metrics_dashboard_path(project))
+ end
+ end
+
+ context '/:namespace/:project/-/metrics/some_custom_dashboard.yml' do
+ let(:path) { "#{project_metrics_dashboard_path(project)}/some_custom_dashboard.yml" }
+
+ it 'uses correct path for metrics-dashboard-base-path' do
+ expect(metrics_data['metrics-dashboard-base-path']).to eq(project_metrics_dashboard_path(project))
+ end
+ end
+ end
end
describe '#custom_metrics_available?' do