diff options
author | rpereira2 <rpereira@gitlab.com> | 2019-04-17 15:16:11 +0530 |
---|---|---|
committer | syasonik <syasonik@gitlab.com> | 2019-04-24 18:23:03 +0800 |
commit | 4a9002cee3c80a9de24f01a5eb313ff17d2e4931 (patch) | |
tree | 922be7c059a53487e58025bf6836a2009d9c19c0 /spec/lib | |
parent | b209fb6fb21369b381e4a538f2e46ef1b6579aed (diff) | |
download | gitlab-ce-4a9002cee3c80a9de24f01a5eb313ff17d2e4931.tar.gz |
Inherit from BaseService
Change MetricsDashboard::Service to inherit from BaseService so that
it can reuse methods like initialize, success, error.
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/metrics_dashboard/service_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/lib/gitlab/metrics_dashboard/service_spec.rb b/spec/lib/gitlab/metrics_dashboard/service_spec.rb index 416b84687a9..f9574889314 100644 --- a/spec/lib/gitlab/metrics_dashboard/service_spec.rb +++ b/spec/lib/gitlab/metrics_dashboard/service_spec.rb @@ -7,11 +7,13 @@ describe Gitlab::MetricsDashboard::Service, :use_clean_rails_memory_store_cachin describe 'get_dashboard' do it 'returns a json representation of the environment dashboard' do - dashboard = described_class.new(project).get_dashboard - json = JSON.parse(dashboard, symbolize_names: true) + result = described_class.new(project).get_dashboard - expect(json).to include(:dashboard, :order, :panel_groups) - expect(json[:panel_groups]).to all( include(:group, :priority, :panels) ) + expect(result.keys).to contain_exactly(:dashboard, :status) + expect(result[:status]).to eq(:success) + + expect(result[:dashboard]).to include('dashboard', 'order', 'panel_groups') + expect(result[:dashboard]['panel_groups']).to all( include('group', 'priority', 'panels') ) end it 'caches the dashboard for subsequent calls' do |