Skip to content

Commit 8877f2e

Browse files
committed
Reword success to passing for pipeline badges
1 parent 2086483 commit 8877f2e

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Update build badges to be pipeline badges and display passing instead of success
3+
merge_request:
4+
author:

features/steps/project/badges/build.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
99
end
1010

1111
step 'I should see a build success badge' do
12-
expect_badge('success')
12+
expect_badge('passed')
1313
end
1414

1515
step 'I should see a build failed badge' do

lib/gitlab/badge/pipeline/template.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Pipeline
77
# Template object will be passed to badge.svg.erb template.
88
#
99
class Template < Badge::Template
10+
STATUS_RENAME = { 'success' => 'passed' }.freeze
1011
STATUS_COLOR = {
1112
success: '#4c1',
1213
failed: '#e05d44',
@@ -27,7 +28,7 @@ def key_text
2728
end
2829

2930
def value_text
30-
@status.to_s
31+
STATUS_RENAME[@status.to_s] || @status.to_s
3132
end
3233

3334
def key_width
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require 'spec_helper'
2+
3+
feature 'pipeline badge' do
4+
let(:project) { create(:project, :repository, :public) }
5+
6+
# this can't be tested in the controller, as it bypasses the rails router
7+
# and constructs a route based on the controller being tested
8+
# Keep around until 10.0, see gitlab-org/gitlab-ce#35307
9+
scenario 'user request the deprecated build status badge' do
10+
visit build_project_badges_path(project, ref: project.default_branch, format: :svg)
11+
12+
expect(page.status_code).to eq(200)
13+
end
14+
end

spec/lib/gitlab/badge/pipeline/template_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
describe '#value_text' do
1414
it 'is status value' do
15-
expect(template.value_text).to eq 'success'
15+
expect(template.value_text).to eq 'passed'
1616
end
1717
end
1818

0 commit comments

Comments
 (0)