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
iv
gitlab-ce
Commits
e995e1f5
Commit
e995e1f5
authored
Jun 06, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into rename-ci-commit
parents
c5d3ca3e
ac4e3e8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
spec/lib/gitlab/badge/build_spec.rb
spec/lib/gitlab/badge/build_spec.rb
+23
-3
No files found.
spec/lib/gitlab/badge/build_spec.rb
View file @
e995e1f5
...
...
@@ -42,9 +42,7 @@ describe Gitlab::Badge::Build do
end
context
'build exists'
do
let
(
:ci_commit
)
{
create
(
:ci_commit
,
project:
project
,
sha:
sha
,
ref:
branch
)
}
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
ci_commit
)
}
let!
(
:build
)
{
create_build
(
project
,
sha
,
branch
)
}
context
'build success'
do
before
{
build
.
success!
}
...
...
@@ -96,6 +94,28 @@ 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
.
to_s
).
to
eq
'build-success'
end
end
def
create_build
(
project
,
sha
,
branch
)
ci_commit
=
create
(
:ci_commit
,
project:
project
,
sha:
sha
,
ref:
branch
)
create
(
:ci_build
,
pipeline:
ci_commit
)
end
def
status_node
(
data
,
status
)
xml
=
Nokogiri
::
XML
.
parse
(
data
)
xml
.
at
(
%Q{text:contains("
#{
status
}
")}
)
...
...
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