diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/models/performance_monitoring | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/models/performance_monitoring')
4 files changed, 11 insertions, 11 deletions
diff --git a/spec/models/performance_monitoring/prometheus_dashboard_spec.rb b/spec/models/performance_monitoring/prometheus_dashboard_spec.rb index ef7298c3d8c..61174a7d0c5 100644 --- a/spec/models/performance_monitoring/prometheus_dashboard_spec.rb +++ b/spec/models/performance_monitoring/prometheus_dashboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PerformanceMonitoring::PrometheusDashboard do +RSpec.describe PerformanceMonitoring::PrometheusDashboard do let(:json_content) do { "dashboard" => "Dashboard Title", @@ -50,19 +50,19 @@ describe PerformanceMonitoring::PrometheusDashboard do context 'dashboard content is missing' do let(:json_content) { nil } - it_behaves_like 'validation failed', panel_groups: ["can't be blank"], dashboard: ["can't be blank"] + it_behaves_like 'validation failed', panel_groups: ["should be an array of panel_groups objects"], dashboard: ["can't be blank"] end context 'dashboard content is NOT a hash' do let(:json_content) { YAML.safe_load("'test'") } - it_behaves_like 'validation failed', panel_groups: ["can't be blank"], dashboard: ["can't be blank"] + it_behaves_like 'validation failed', panel_groups: ["should be an array of panel_groups objects"], dashboard: ["can't be blank"] end context 'content is an array' do let(:json_content) { [{ "dashboard" => "Dashboard Title" }] } - it_behaves_like 'validation failed', panel_groups: ["can't be blank"], dashboard: ["can't be blank"] + it_behaves_like 'validation failed', panel_groups: ["should be an array of panel_groups objects"], dashboard: ["can't be blank"] end context 'dashboard definition is missing panels_groups and dashboard keys' do @@ -72,7 +72,7 @@ describe PerformanceMonitoring::PrometheusDashboard do } end - it_behaves_like 'validation failed', panel_groups: ["can't be blank"], dashboard: ["can't be blank"] + it_behaves_like 'validation failed', panel_groups: ["should be an array of panel_groups objects"], dashboard: ["can't be blank"] end context 'group definition is missing panels and group keys' do @@ -88,7 +88,7 @@ describe PerformanceMonitoring::PrometheusDashboard do } end - it_behaves_like 'validation failed', panels: ["can't be blank"], group: ["can't be blank"] + it_behaves_like 'validation failed', panels: ["should be an array of panels objects"], group: ["can't be blank"] end context 'panel definition is missing metrics and title keys' do @@ -110,7 +110,7 @@ describe PerformanceMonitoring::PrometheusDashboard do } end - it_behaves_like 'validation failed', metrics: ["can't be blank"], title: ["can't be blank"] + it_behaves_like 'validation failed', metrics: ["should be an array of metrics objects"], title: ["can't be blank"] end context 'metrics definition is missing unit, query and query_range keys' do @@ -180,7 +180,7 @@ describe PerformanceMonitoring::PrometheusDashboard do describe '.find_for' do let(:project) { build_stubbed(:project) } let(:user) { build_stubbed(:user) } - let(:environment) { build_stubbed(:environment) } + let(:environment) { build_stubbed(:environment, project: project) } let(:path) { ::Metrics::Dashboard::SystemDashboardService::DASHBOARD_PATH } context 'dashboard has been found' do diff --git a/spec/models/performance_monitoring/prometheus_metric_spec.rb b/spec/models/performance_monitoring/prometheus_metric_spec.rb index 83f687aa90e..b5b9cd58aa8 100644 --- a/spec/models/performance_monitoring/prometheus_metric_spec.rb +++ b/spec/models/performance_monitoring/prometheus_metric_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PerformanceMonitoring::PrometheusMetric do +RSpec.describe PerformanceMonitoring::PrometheusMetric do let(:json_content) do { "id" => "metric_of_ages", diff --git a/spec/models/performance_monitoring/prometheus_panel_group_spec.rb b/spec/models/performance_monitoring/prometheus_panel_group_spec.rb index ecf7e13a9a3..9e92cb27954 100644 --- a/spec/models/performance_monitoring/prometheus_panel_group_spec.rb +++ b/spec/models/performance_monitoring/prometheus_panel_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PerformanceMonitoring::PrometheusPanelGroup do +RSpec.describe PerformanceMonitoring::PrometheusPanelGroup do let(:json_content) do { "group" => "Group Title", diff --git a/spec/models/performance_monitoring/prometheus_panel_spec.rb b/spec/models/performance_monitoring/prometheus_panel_spec.rb index 127b9e8183a..c5c6b1fdafd 100644 --- a/spec/models/performance_monitoring/prometheus_panel_spec.rb +++ b/spec/models/performance_monitoring/prometheus_panel_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PerformanceMonitoring::PrometheusPanel do +RSpec.describe PerformanceMonitoring::PrometheusPanel do let(:json_content) do { "max_value" => 1, |