Commit 8877f2e8 authored by Z.J. van de Weg's avatar Z.J. van de Weg

Reword success to passing for pipeline badges

parent 2086483b
---
title: Update build badges to be pipeline badges and display passing instead of success
merge_request:
author:
...@@ -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
......
...@@ -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
......
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
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment