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
Boxiang Sun
gitlab-ce
Commits
8877f2e8
Commit
8877f2e8
authored
Jul 19, 2017
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reword success to passing for pipeline badges
parent
2086483b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
3 deletions
+22
-3
changelogs/unreleased/zj-pipeline-badge-improvements.yml
changelogs/unreleased/zj-pipeline-badge-improvements.yml
+4
-0
features/steps/project/badges/build.rb
features/steps/project/badges/build.rb
+1
-1
lib/gitlab/badge/pipeline/template.rb
lib/gitlab/badge/pipeline/template.rb
+2
-1
spec/features/projects/badges/pipeline_badge_spec.rb
spec/features/projects/badges/pipeline_badge_spec.rb
+14
-0
spec/lib/gitlab/badge/pipeline/template_spec.rb
spec/lib/gitlab/badge/pipeline/template_spec.rb
+1
-1
No files found.
changelogs/unreleased/zj-pipeline-badge-improvements.yml
0 → 100644
View file @
8877f2e8
---
title
:
Update build badges to be pipeline badges and display passing instead of success
merge_request
:
author
:
features/steps/project/badges/build.rb
View file @
8877f2e8
...
@@ -9,7 +9,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
...
@@ -9,7 +9,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
end
end
step
'I should see a build success badge'
do
step
'I should see a build success badge'
do
expect_badge
(
'
success
'
)
expect_badge
(
'
passed
'
)
end
end
step
'I should see a build failed badge'
do
step
'I should see a build failed badge'
do
...
...
lib/gitlab/badge/pipeline/template.rb
View file @
8877f2e8
...
@@ -7,6 +7,7 @@ module Gitlab
...
@@ -7,6 +7,7 @@ module Gitlab
# Template object will be passed to badge.svg.erb template.
# Template object will be passed to badge.svg.erb template.
#
#
class
Template
<
Badge
::
Template
class
Template
<
Badge
::
Template
STATUS_RENAME
=
{
'success'
=>
'passed'
}.
freeze
STATUS_COLOR
=
{
STATUS_COLOR
=
{
success:
'#4c1'
,
success:
'#4c1'
,
failed:
'#e05d44'
,
failed:
'#e05d44'
,
...
@@ -27,7 +28,7 @@ module Gitlab
...
@@ -27,7 +28,7 @@ module Gitlab
end
end
def
value_text
def
value_text
@status
.
to_s
STATUS_RENAME
[
@status
.
to_s
]
||
@status
.
to_s
end
end
def
key_width
def
key_width
...
...
spec/features/projects/badges/pipeline_badge_spec.rb
0 → 100644
View file @
8877f2e8
require
'spec_helper'
feature
'pipeline badge'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
# this can't be tested in the controller, as it bypasses the rails router
# and constructs a route based on the controller being tested
# Keep around until 10.0, see gitlab-org/gitlab-ce#35307
scenario
'user request the deprecated build status badge'
do
visit
build_project_badges_path
(
project
,
ref:
project
.
default_branch
,
format: :svg
)
expect
(
page
.
status_code
).
to
eq
(
200
)
end
end
spec/lib/gitlab/badge/pipeline/template_spec.rb
View file @
8877f2e8
...
@@ -12,7 +12,7 @@ describe Gitlab::Badge::Pipeline::Template do
...
@@ -12,7 +12,7 @@ describe Gitlab::Badge::Pipeline::Template do
describe
'#value_text'
do
describe
'#value_text'
do
it
'is status value'
do
it
'is status value'
do
expect
(
template
.
value_text
).
to
eq
'
success
'
expect
(
template
.
value_text
).
to
eq
'
passed
'
end
end
end
end
...
...
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