diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/serializers/ci | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/serializers/ci')
-rw-r--r-- | spec/serializers/ci/pipeline_entity_spec.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/serializers/ci/pipeline_entity_spec.rb b/spec/serializers/ci/pipeline_entity_spec.rb index 808dc38f653..ff364918b4f 100644 --- a/spec/serializers/ci/pipeline_entity_spec.rb +++ b/spec/serializers/ci/pipeline_entity_spec.rb @@ -15,12 +15,13 @@ RSpec.describe Ci::PipelineEntity do subject { entity.as_json } context 'when pipeline is empty' do - let(:pipeline) { create(:ci_empty_pipeline) } + let(:pipeline) { create(:ci_empty_pipeline, name: 'Build pipeline') } it 'contains required fields' do expect(subject).to include :id, :iid, :user, :path, :coverage, :source expect(subject).to include :ref, :commit expect(subject).to include :updated_at, :created_at + expect(subject[:name]).to eq('Build pipeline') end it 'excludes coverage data when disabled' do @@ -31,10 +32,15 @@ RSpec.describe Ci::PipelineEntity do end it 'contains details' do + allow(pipeline).to receive(:merge_request_event_type).and_return(:merged_result) + expect(subject).to include :details expect(subject[:details]) - .to include :duration, :finished_at, :name + .to include :duration, :finished_at, :name, :event_type_name expect(subject[:details][:status]).to include :icon, :favicon, :text, :label, :tooltip + + expect(subject[:details][:event_type_name]).to eq('Merged result pipeline') + expect(subject[:details][:name]).to eq('Merged result pipeline') end it 'contains flags' do @@ -43,6 +49,16 @@ RSpec.describe Ci::PipelineEntity do .to include :stuck, :auto_devops, :yaml_errors, :retryable, :cancelable, :merge_request end + + context 'when pipeline_name feature flag is disabled' do + before do + stub_feature_flags(pipeline_name: false) + end + + it 'does not return name' do + is_expected.not_to include(:name) + end + end end context 'when default branch not protected' do |