diff options
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/ci/dag_job_group_entity_spec.rb | 8 | ||||
-rw-r--r-- | spec/serializers/ci/dag_stage_entity_spec.rb | 4 | ||||
-rw-r--r-- | spec/serializers/stage_entity_spec.rb | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/spec/serializers/ci/dag_job_group_entity_spec.rb b/spec/serializers/ci/dag_job_group_entity_spec.rb index 5a75c04efe5..d05dd8b05b9 100644 --- a/spec/serializers/ci/dag_job_group_entity_spec.rb +++ b/spec/serializers/ci/dag_job_group_entity_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe Ci::DagJobGroupEntity do let_it_be(:request) { double(:request) } let_it_be(:pipeline) { create(:ci_pipeline) } - let_it_be(:stage) { create(:ci_stage, pipeline: pipeline) } + let_it_be(:stage) { create(:ci_stage_entity, pipeline: pipeline) } let(:group) { Ci::Group.new(pipeline.project, stage, name: 'test', jobs: jobs) } let(:entity) { described_class.new(group, request: request) } @@ -14,7 +14,7 @@ RSpec.describe Ci::DagJobGroupEntity do subject { entity.as_json } context 'when group contains 1 job' do - let(:job) { create(:ci_build, stage: stage, pipeline: pipeline, name: 'test') } + let(:job) { create(:ci_build, stage_id: stage.id, pipeline: pipeline, name: 'test') } let(:jobs) { [job] } it 'exposes a name' do @@ -38,8 +38,8 @@ RSpec.describe Ci::DagJobGroupEntity do end context 'when group contains multiple parallel jobs' do - let(:job_1) { create(:ci_build, stage: stage, pipeline: pipeline, name: 'test 1/2') } - let(:job_2) { create(:ci_build, stage: stage, pipeline: pipeline, name: 'test 2/2') } + let(:job_1) { create(:ci_build, stage_id: stage.id, pipeline: pipeline, name: 'test 1/2') } + let(:job_2) { create(:ci_build, stage_id: stage.id, pipeline: pipeline, name: 'test 2/2') } let(:jobs) { [job_1, job_2] } it 'exposes a name' do diff --git a/spec/serializers/ci/dag_stage_entity_spec.rb b/spec/serializers/ci/dag_stage_entity_spec.rb index 0262ccdac68..554437ecef5 100644 --- a/spec/serializers/ci/dag_stage_entity_spec.rb +++ b/spec/serializers/ci/dag_stage_entity_spec.rb @@ -6,10 +6,10 @@ RSpec.describe Ci::DagStageEntity do let_it_be(:pipeline) { create(:ci_pipeline) } let_it_be(:request) { double(:request) } - let(:stage) { build(:ci_stage, pipeline: pipeline, name: 'test') } + let(:stage) { create(:ci_stage_entity, pipeline: pipeline, name: 'test') } let(:entity) { described_class.new(stage, request: request) } - let!(:job) { create(:ci_build, :success, pipeline: pipeline) } + let!(:job) { create(:ci_build, :success, pipeline: pipeline, stage_id: stage.id) } describe '#as_json' do subject { entity.as_json } diff --git a/spec/serializers/stage_entity_spec.rb b/spec/serializers/stage_entity_spec.rb index b977d5d33aa..ab74ce76cbd 100644 --- a/spec/serializers/stage_entity_spec.rb +++ b/spec/serializers/stage_entity_spec.rb @@ -12,12 +12,12 @@ RSpec.describe StageEntity do end let(:stage) do - build(:ci_stage, pipeline: pipeline, name: 'test') + create(:ci_stage_entity, pipeline: pipeline, status: :success) end before do allow(request).to receive(:current_user).and_return(user) - create(:ci_build, :success, pipeline: pipeline) + create(:ci_build, :success, pipeline: pipeline, stage_id: stage.id) end describe '#as_json' do |