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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
cf0eab50
Commit
cf0eab50
authored
Feb 08, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature tests for builds status badge
parent
eb7721e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
2 deletions
+52
-2
features/project/builds/badge.feature
features/project/builds/badge.feature
+17
-0
features/steps/project/builds/badge.rb
features/steps/project/builds/badge.rb
+25
-0
features/steps/shared/builds.rb
features/steps/shared/builds.rb
+10
-2
No files found.
features/project/builds/badge.feature
0 → 100644
View file @
cf0eab50
Feature
:
Project Builds Badge
Background
:
Given
project exists in some group namespace
And
project has CI enabled
And
project has a recent build
Scenario
:
I
want to see a badge for successfully built project
Given
recent build is successfull
When
I display builds badge for a master branch
Then
I should see a build success badge
And
build badge is a svg image
Scenario
:
I
want to see a badge for project with filed builds
Given
recent build failed
When
I display builds badge for a master branch
Then
I should see a build failed badge
And
build badge is a svg image
features/steps/project/builds/badge.rb
0 → 100644
View file @
cf0eab50
class
Spinach::Features::ProjectBuildsBadge
<
Spinach
::
FeatureSteps
include
SharedProject
include
SharedBuilds
include
RepoHelpers
step
'I display builds badge for a master branch'
do
visit
badge_namespace_project_builds_path
(
@project
.
namespace
,
@project
,
ref: :master
,
format: :svg
)
end
step
'I should see a build success badge'
do
expect
(
svg
.
at
(
'text:contains("success")'
)).
to
be_truthy
end
step
'I should see a build failed badge'
do
expect
(
svg
.
at
(
'text:contains("failed")'
)).
to
be_truthy
end
step
'build badge is a svg image'
do
expect
(
page
.
response_headers
).
to
include
(
'Content-Type'
=>
'image/svg+xml'
)
end
def
svg
Nokogiri
::
HTML
.
parse
(
page
.
body
)
end
end
features/steps/shared/builds.rb
View file @
cf0eab50
...
...
@@ -6,8 +6,16 @@ module SharedBuilds
end
step
'project has a recent build'
do
ci_commit
=
create
:ci_commit
,
project:
@project
,
sha:
sample_commit
.
id
@build
=
create
:ci_build
,
commit:
ci_commit
@ci_commit
=
create
(
:ci_commit
,
project:
@project
,
sha:
@project
.
commit
.
sha
)
@build
=
create
(
:ci_build
,
commit:
@ci_commit
)
end
step
'recent build is successfull'
do
@build
.
update_column
(
:status
,
'success'
)
end
step
'recent build failed'
do
@build
.
update_column
(
:status
,
'failed'
)
end
step
'I visit recent build details page'
do
...
...
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