diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/lib/gitlab/metrics/dashboard/processor_spec.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/lib/gitlab/metrics/dashboard/processor_spec.rb')
-rw-r--r-- | spec/lib/gitlab/metrics/dashboard/processor_spec.rb | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/spec/lib/gitlab/metrics/dashboard/processor_spec.rb b/spec/lib/gitlab/metrics/dashboard/processor_spec.rb index 7250cefb9ff..7f7070dfafb 100644 --- a/spec/lib/gitlab/metrics/dashboard/processor_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/processor_spec.rb @@ -2,10 +2,12 @@ require 'spec_helper' -describe Gitlab::Metrics::Dashboard::Processor do +RSpec.describe Gitlab::Metrics::Dashboard::Processor do + include MetricsDashboardHelpers + let(:project) { build(:project) } let(:environment) { create(:environment, project: project) } - let(:dashboard_yml) { YAML.load_file('spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml') } + let(:dashboard_yml) { load_sample_dashboard } describe 'process' do let(:sequence) do @@ -13,7 +15,7 @@ describe Gitlab::Metrics::Dashboard::Processor do Gitlab::Metrics::Dashboard::Stages::CommonMetricsInserter, Gitlab::Metrics::Dashboard::Stages::CustomMetricsInserter, Gitlab::Metrics::Dashboard::Stages::CustomMetricsDetailsInserter, - Gitlab::Metrics::Dashboard::Stages::EndpointInserter, + Gitlab::Metrics::Dashboard::Stages::MetricEndpointInserter, Gitlab::Metrics::Dashboard::Stages::Sorter, Gitlab::Metrics::Dashboard::Stages::AlertsInserter, Gitlab::Metrics::Dashboard::Stages::PanelIdsInserter, @@ -98,7 +100,7 @@ describe Gitlab::Metrics::Dashboard::Processor do let(:sequence) do [ Gitlab::Metrics::Dashboard::Stages::CommonMetricsInserter, - Gitlab::Metrics::Dashboard::Stages::EndpointInserter, + Gitlab::Metrics::Dashboard::Stages::MetricEndpointInserter, Gitlab::Metrics::Dashboard::Stages::Sorter ] end @@ -202,27 +204,6 @@ describe Gitlab::Metrics::Dashboard::Processor do it_behaves_like 'errors with message', 'Each "metric" must define one of :query or :query_range' end - - describe 'validating links' do - context 'when the links contain a blocked url' do - let(:dashboard_yml_links) do - [{ 'url' => 'http://1.1.1.1.1' }, { 'url' => 'https://gitlab.com' }] - end - - let(:expected) do - [{ url: '' }, { url: 'https://gitlab.com' }] - end - - before do - stub_env('RSPEC_ALLOW_INVALID_URLS', 'false') - dashboard_yml['links'] = dashboard_yml_links - end - - it 'replaces the blocked url with an empty string' do - expect(dashboard[:links]).to eq(expected) - end - end - end end private |