Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
609328a2
Commit
609328a2
authored
Apr 03, 2019
by
Grzegorz Bizon
Committed by
Grzegorz Bizon
Apr 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a unit test for serializing pipelines with bridges
parent
5665fd9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
ee/spec/serializers/pipeline_serializer_spec.rb
ee/spec/serializers/pipeline_serializer_spec.rb
+31
-0
spec/factories/ci/bridge.rb
spec/factories/ci/bridge.rb
+1
-1
No files found.
ee/spec/serializers/pipeline_serializer_spec.rb
0 → 100644
View file @
609328a2
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 bridge jobs'
do
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
status: :success
,
ref: :master
)
end
before
do
create
(
:ci_bridge
,
pipeline:
pipeline
)
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
spec/factories/ci/bridge.rb
View file @
609328a2
FactoryBot
.
define
do
FactoryBot
.
define
do
factory
:ci_bridge
,
class:
Ci
::
Bridge
do
factory
:ci_bridge
,
class:
Ci
::
Bridge
do
name
'
bridge'
name
'bridge'
stage
'test'
stage
'test'
stage_idx
0
stage_idx
0
ref
'master'
ref
'master'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment