Commit 26a31c2f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'fix/gb/fix-bridge-jobs-serialization' into 'master'

Fix pipeline bridge serialization error

Closes gitlab-ce#59221

See merge request gitlab-org/gitlab-ee!10565
parents 14471ec1 971153d3
---
title: Fix pipeline bridge serialization error
merge_request: 10565
author:
type: fixed
require 'spec_helper'
describe PipelineSerializer do
set(:project) { create(:project, :repository) }
set(:user) { create(:user) }
let(:serializer) do
described_class.new(current_user: user)
end
subject { serializer.represent(pipeline, details: true) }
context 'when pipeline contains failed bridge jobs' do
let(:pipeline) do
create(:ci_empty_pipeline,
project: project,
status: :success,
ref: :master)
end
before do
create(:ci_bridge, pipeline: pipeline, status: :failed)
end
it 'serializes bridge job correctly' do
name = subject.dig(:details, :stages, 0, :latest_statuses, 0, :name)
expect(name).to eq 'bridge'
end
end
end
FactoryBot.define do
factory :ci_bridge, class: Ci::Bridge do
name ' bridge'
name 'bridge'
stage 'test'
stage_idx 0
ref 'master'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment