diff options
Diffstat (limited to 'spec/services/projects/operations')
-rw-r--r-- | spec/services/projects/operations/update_service_spec.rb | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/spec/services/projects/operations/update_service_spec.rb b/spec/services/projects/operations/update_service_spec.rb index 99a9fdd4184..f4d62b48fe5 100644 --- a/spec/services/projects/operations/update_service_spec.rb +++ b/spec/services/projects/operations/update_service_spec.rb @@ -96,7 +96,8 @@ describe Projects::Operations::UpdateService do let(:params) do { metrics_setting_attributes: { - external_dashboard_url: 'http://gitlab.com' + external_dashboard_url: 'http://gitlab.com', + dashboard_timezone: 'utc' } } end @@ -108,6 +109,7 @@ describe Projects::Operations::UpdateService do expect(project.reload.metrics_setting.external_dashboard_url).to eq( 'http://gitlab.com' ) + expect(project.metrics_setting.dashboard_timezone).to eq('utc') end end @@ -122,22 +124,25 @@ describe Projects::Operations::UpdateService do expect(project.reload.metrics_setting.external_dashboard_url).to eq( 'http://gitlab.com' ) + expect(project.metrics_setting.dashboard_timezone).to eq('utc') end + end - context 'with blank external_dashboard_url in params' do - let(:params) do - { - metrics_setting_attributes: { - external_dashboard_url: '' - } + context 'with blank external_dashboard_url' do + let(:params) do + { + metrics_setting_attributes: { + external_dashboard_url: '', + dashboard_timezone: 'utc' } - end + } + end - it 'destroys the metrics_setting entry in DB' do - expect(result[:status]).to eq(:success) + it 'updates dashboard_timezone' do + expect(result[:status]).to eq(:success) - expect(project.reload.metrics_setting).to be_nil - end + expect(project.reload.metrics_setting.external_dashboard_url).to be(nil) + expect(project.metrics_setting.dashboard_timezone).to eq('utc') end end end |