diff options
Diffstat (limited to 'spec/services/ci/pipelines')
-rw-r--r-- | spec/services/ci/pipelines/add_job_service_spec.rb | 8 | ||||
-rw-r--r-- | spec/services/ci/pipelines/hook_service_spec.rb | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/spec/services/ci/pipelines/add_job_service_spec.rb b/spec/services/ci/pipelines/add_job_service_spec.rb index 560724a1c6a..e735b2752d9 100644 --- a/spec/services/ci/pipelines/add_job_service_spec.rb +++ b/spec/services/ci/pipelines/add_job_service_spec.rb @@ -34,6 +34,14 @@ RSpec.describe Ci::Pipelines::AddJobService do ).and change { job.metadata.project }.to(pipeline.project) end + it 'assigns partition_id to job and metadata' do + pipeline.partition_id = 123 + + expect { execute } + .to change(job, :partition_id).to(pipeline.partition_id) + .and change { job.metadata.partition_id }.to(pipeline.partition_id) + end + it 'returns a service response with the job as payload' do expect(execute).to be_success expect(execute.payload[:job]).to eq(job) diff --git a/spec/services/ci/pipelines/hook_service_spec.rb b/spec/services/ci/pipelines/hook_service_spec.rb index 0e1ef6afd0d..8d138a3d957 100644 --- a/spec/services/ci/pipelines/hook_service_spec.rb +++ b/spec/services/ci/pipelines/hook_service_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Ci::Pipelines::HookService do describe '#execute_hooks' do let_it_be(:namespace) { create(:namespace) } let_it_be(:project) { create(:project, :repository, namespace: namespace) } - let_it_be(:pipeline) { create(:ci_empty_pipeline, :created, project: project) } + let_it_be(:pipeline, reload: true) { create(:ci_empty_pipeline, :created, project: project) } let(:hook_enabled) { true } let!(:hook) { create(:project_hook, project: project, pipeline_events: hook_enabled) } |