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
Léo-Paul Géneau
gitlab-ce
Commits
8527f3fa
Commit
8527f3fa
authored
Aug 18, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update coverage report badge feature tests
parent
804474d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
spec/features/projects/badges/coverage_spec.rb
spec/features/projects/badges/coverage_spec.rb
+25
-16
No files found.
spec/features/projects/badges/coverage_spec.rb
View file @
8527f3fa
...
@@ -4,12 +4,6 @@ feature 'test coverage badge' do
...
@@ -4,12 +4,6 @@ feature 'test coverage badge' do
given!
(
:user
)
{
create
(
:user
)
}
given!
(
:user
)
{
create
(
:user
)
}
given!
(
:project
)
{
create
(
:project
,
:private
)
}
given!
(
:project
)
{
create
(
:project
,
:private
)
}
given!
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
ref:
'master'
,
sha:
project
.
commit
.
id
)
end
context
'when user has access to view badge'
do
context
'when user has access to view badge'
do
background
do
background
do
project
.
team
<<
[
user
,
:developer
]
project
.
team
<<
[
user
,
:developer
]
...
@@ -17,8 +11,10 @@ feature 'test coverage badge' do
...
@@ -17,8 +11,10 @@ feature 'test coverage badge' do
end
end
scenario
'user requests coverage badge image for pipeline'
do
scenario
'user requests coverage badge image for pipeline'
do
create_job
(
coverage:
100
,
name:
'test:1'
)
create_pipeline
do
|
pipeline
|
create_job
(
coverage:
90
,
name:
'test:2'
)
create_build
(
pipeline
,
coverage:
100
,
name:
'test:1'
)
create_build
(
pipeline
,
coverage:
90
,
name:
'test:2'
)
end
show_test_coverage_badge
show_test_coverage_badge
...
@@ -26,9 +22,11 @@ feature 'test coverage badge' do
...
@@ -26,9 +22,11 @@ feature 'test coverage badge' do
end
end
scenario
'user requests coverage badge for specific job'
do
scenario
'user requests coverage badge for specific job'
do
create_job
(
coverage:
50
,
name:
'test:1'
)
create_pipeline
do
|
pipeline
|
create_job
(
coverage:
50
,
name:
'test:2'
)
create_build
(
pipeline
,
coverage:
50
,
name:
'test:1'
)
create_job
(
coverage:
85
,
name:
'coverage'
)
create_build
(
pipeline
,
coverage:
50
,
name:
'test:2'
)
create_build
(
pipeline
,
coverage:
85
,
name:
'coverage'
)
end
show_test_coverage_badge
(
job:
'coverage'
)
show_test_coverage_badge
(
job:
'coverage'
)
...
@@ -36,7 +34,9 @@ feature 'test coverage badge' do
...
@@ -36,7 +34,9 @@ feature 'test coverage badge' do
end
end
scenario
'user requests coverage badge for pipeline without coverage'
do
scenario
'user requests coverage badge for pipeline without coverage'
do
create_job
(
coverage:
nil
,
name:
'test'
)
create_pipeline
do
|
pipeline
|
create_build
(
pipeline
,
coverage:
nil
,
name:
'test'
)
end
show_test_coverage_badge
show_test_coverage_badge
...
@@ -54,10 +54,19 @@ feature 'test coverage badge' do
...
@@ -54,10 +54,19 @@ feature 'test coverage badge' do
end
end
end
end
def
create_job
(
coverage
:,
name
:)
def
create_pipeline
create
(
:ci_build
,
name:
name
,
opts
=
{
project:
project
,
ref:
'master'
,
sha:
project
.
commit
.
id
}
coverage:
coverage
,
pipeline:
pipeline
)
create
(
:ci_pipeline
,
opts
).
tap
do
|
pipeline
|
yield
pipeline
pipeline
.
build_updated
end
end
def
create_build
(
pipeline
,
coverage
:,
name
:)
opts
=
{
pipeline:
pipeline
,
coverage:
coverage
,
name:
name
}
create
(
:ci_build
,
:success
,
opts
)
end
end
def
show_test_coverage_badge
(
job:
nil
)
def
show_test_coverage_badge
(
job:
nil
)
...
...
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