diff options
Diffstat (limited to 'spec/services/projects/operations/update_service_spec.rb')
-rw-r--r-- | spec/services/projects/operations/update_service_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/services/projects/operations/update_service_spec.rb b/spec/services/projects/operations/update_service_spec.rb index 018bfa8ef61..f91f879b772 100644 --- a/spec/services/projects/operations/update_service_spec.rb +++ b/spec/services/projects/operations/update_service_spec.rb @@ -378,8 +378,8 @@ RSpec.describe Projects::Operations::UpdateService do context 'prometheus integration' do context 'prometheus params were passed into service' do - let(:prometheus_service) do - build_stubbed(:prometheus_service, project: project, properties: { + let(:prometheus_integration) do + build_stubbed(:prometheus_integration, project: project, properties: { api_url: "http://example.prometheus.com", manual_configuration: "0" }) @@ -394,18 +394,18 @@ RSpec.describe Projects::Operations::UpdateService do } end - it 'uses Project#find_or_initialize_service to include instance defined defaults and pass them to Projects::UpdateService', :aggregate_failures do + it 'uses Project#find_or_initialize_integration to include instance defined defaults and pass them to Projects::UpdateService', :aggregate_failures do project_update_service = double(Projects::UpdateService) expect(project) - .to receive(:find_or_initialize_service) + .to receive(:find_or_initialize_integration) .with('prometheus') - .and_return(prometheus_service) + .and_return(prometheus_integration) expect(Projects::UpdateService).to receive(:new) do |project_arg, user_arg, update_params_hash| expect(project_arg).to eq project expect(user_arg).to eq user - expect(update_params_hash[:prometheus_service_attributes]).to include('properties' => { 'api_url' => 'http://new.prometheus.com', 'manual_configuration' => '1' }) - expect(update_params_hash[:prometheus_service_attributes]).not_to include(*%w(id project_id created_at updated_at)) + expect(update_params_hash[:prometheus_integration_attributes]).to include('properties' => { 'api_url' => 'http://new.prometheus.com', 'manual_configuration' => '1' }) + expect(update_params_hash[:prometheus_integration_attributes]).not_to include(*%w(id project_id created_at updated_at)) end.and_return(project_update_service) expect(project_update_service).to receive(:execute) @@ -413,13 +413,13 @@ RSpec.describe Projects::Operations::UpdateService do end end - context 'prometheus params were not passed into service' do + context 'when prometheus params are not passed into service' do let(:params) { { something: :else } } it 'does not pass any prometheus params into Projects::UpdateService', :aggregate_failures do project_update_service = double(Projects::UpdateService) - expect(project).not_to receive(:find_or_initialize_service) + expect(project).not_to receive(:find_or_initialize_integration) expect(Projects::UpdateService) .to receive(:new) .with(project, user, {}) |