From 20438213d5f16907f0b0ea2cd2722b6ccfdc7556 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 18 Jul 2016 14:56:22 +0200 Subject: [PATCH] Use `capitalize` instead of `titleize` for manual actions --- app/views/projects/ci/pipelines/_pipeline.html.haml | 2 +- app/views/projects/deployments/_actions.haml | 2 +- app/views/projects/environments/show.html.haml | 2 +- spec/features/environments_spec.rb | 8 ++++---- spec/features/pipelines_spec.rb | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml index 397f26012d4..797e52d1122 100644 --- a/app/views/projects/ci/pipelines/_pipeline.html.haml +++ b/app/views/projects/ci/pipelines/_pipeline.html.haml @@ -70,7 +70,7 @@ %li = link_to play_namespace_project_build_path(@project.namespace, @project, build), method: :post, rel: 'nofollow' do = icon("play") - %span= build.name.titleize + %span= build.name.capitalize - if artifacts.present? .btn-group %a.dropdown-toggle.btn.btn-default.build-artifacts{type: 'button', 'data-toggle' => 'dropdown'} diff --git a/app/views/projects/deployments/_actions.haml b/app/views/projects/deployments/_actions.haml index 9a8d4a63007..8dd9e70ac67 100644 --- a/app/views/projects/deployments/_actions.haml +++ b/app/views/projects/deployments/_actions.haml @@ -12,7 +12,7 @@ %li = link_to [:play, @project.namespace.becomes(Namespace), @project, action], method: :post, rel: 'nofollow' do = icon("play") - %span= action.name.titleize + %span= action.name.capitalize - if defined?(allow_rollback) && allow_rollback = link_to [:retry, @project.namespace.becomes(Namespace), @project, deployment.deployable], method: :post, class: 'btn btn-build' do diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index b17aba2431f..b8b1ce52a91 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -5,7 +5,7 @@ %div{ class: container_class } .top-area .col-md-9 - %h3.page-title= @environment.name.titleize + %h3.page-title= @environment.name.capitalize .col-md-3 .nav-controls diff --git a/spec/features/environments_spec.rb b/spec/features/environments_spec.rb index 491eec70752..d62b3772fdb 100644 --- a/spec/features/environments_spec.rb +++ b/spec/features/environments_spec.rb @@ -52,12 +52,12 @@ feature 'Environments', feature: true do given(:manual) { create(:ci_build, :manual, pipeline: pipeline, name: 'deploy to production') } scenario 'does show a play button' do - expect(page).to have_link(manual.name.titleize) + expect(page).to have_link(manual.name.capitalize) end scenario 'does allow to play manual action' do expect(manual).to be_skipped - expect{ click_link(manual.name.titleize) }.to change{ Ci::Pipeline.count }.by(0) + expect{ click_link(manual.name.capitalize) }.to change{ Ci::Pipeline.count }.by(0) expect(page).to have_content(manual.name) expect(manual.reload).to be_pending end @@ -113,12 +113,12 @@ feature 'Environments', feature: true do given(:manual) { create(:ci_build, :manual, pipeline: pipeline, name: 'deploy to production') } scenario 'does show a play button' do - expect(page).to have_link(manual.name.titleize) + expect(page).to have_link(manual.name.capitalize) end scenario 'does allow to play manual action' do expect(manual).to be_skipped - expect{ click_link(manual.name.titleize) }.to change{ Ci::Pipeline.count }.by(0) + expect{ click_link(manual.name.capitalize) }.to change{ Ci::Pipeline.count }.by(0) expect(page).to have_content(manual.name) expect(manual.reload).to be_pending end diff --git a/spec/features/pipelines_spec.rb b/spec/features/pipelines_spec.rb index 55cecf3d587..7f861db1969 100644 --- a/spec/features/pipelines_spec.rb +++ b/spec/features/pipelines_spec.rb @@ -67,10 +67,10 @@ describe "Pipelines" do before { visit namespace_project_pipelines_path(project.namespace, project) } - it { expect(page).to have_link('Manual Build') } + it { expect(page).to have_link('Manual build') } context 'when playing' do - before { click_link('Manual Build') } + before { click_link('Manual build') } it { expect(manual.reload).to be_pending } end