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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
57df84d2
Commit
57df84d2
authored
Aug 09, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend build badge specs to cover multiple pipelines
parent
d98566dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
+26
-14
spec/lib/gitlab/badge/build_spec.rb
spec/lib/gitlab/badge/build_spec.rb
+26
-14
No files found.
spec/lib/gitlab/badge/build_spec.rb
View file @
57df84d2
...
...
@@ -53,6 +53,32 @@ describe Gitlab::Badge::Build do
end
end
end
context
'when outdated pipeline for given ref exists'
do
before
do
build
.
success!
old_build
=
create_build
(
project
,
'11eeffdd'
,
branch
)
old_build
.
drop!
end
it
'does not take outdated pipeline into account'
do
expect
(
badge
.
status
).
to
eq
'success'
end
end
context
'when multiple pipelines exist for given sha'
do
before
do
build
.
drop!
new_build
=
create_build
(
project
,
sha
,
branch
)
new_build
.
success!
end
it
'reports the compound status'
do
expect
(
badge
.
status
).
to
eq
'failed'
end
end
end
context
'build does not exist'
do
...
...
@@ -69,20 +95,6 @@ describe Gitlab::Badge::Build do
end
end
context
'when outdated pipeline for given ref exists'
do
before
do
build
=
create_build
(
project
,
sha
,
branch
)
build
.
success!
old_build
=
create_build
(
project
,
'11eeffdd'
,
branch
)
old_build
.
drop!
end
it
'does not take outdated pipeline into account'
do
expect
(
badge
.
status
).
to
eq
'success'
end
end
def
create_build
(
project
,
sha
,
branch
)
pipeline
=
create
(
:ci_pipeline
,
project:
project
,
sha:
sha
,
...
...
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