Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
6b6604bd4c56
Commit
99850ffb
authored
Jan 23, 2019
by
Grzegorz Bizon
Browse files
Add some specs for processable CI/CD entities relation
parent
130853a8a402
Changes
1
Hide whitespace changes
Inline
Side-by-side
spec/models/ci/pipeline_spec.rb
View file @
6b6604bd
...
...
@@ -39,6 +39,29 @@
end
end
describe
'.processables'
do
before
do
create
(
:ci_build
,
name:
'build'
,
pipeline:
pipeline
)
create
(
:ci_bridge
,
name:
'bridge'
,
pipeline:
pipeline
)
create
(
:commit_status
,
name:
'commit status'
,
pipeline:
pipeline
)
create
(
:generic_commit_status
,
name:
'generic status'
,
pipeline:
pipeline
)
end
it
'has an association with processable CI/CD entities'
do
pipeline
.
processables
.
pluck
(
'name'
).
yield_self
do
|
processables
|
expect
(
processables
).
to
match_array
%w[build bridge]
end
end
it
'makes it possible to append a new processable'
do
pipeline
.
processables
<<
build
(
:ci_bridge
)
pipeline
.
save!
expect
(
pipeline
.
processables
.
reload
.
count
).
to
eq
3
end
end
describe
'.sort_by_merge_request_pipelines'
do
subject
{
described_class
.
sort_by_merge_request_pipelines
}
...
...
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