add git-commit-title-method into pipeline model and modify view

add git-commit-title-method into tests
This commit is contained in:
ubudzisz 2016-07-11 09:11:20 +02:00
parent af1a6f0533
commit fda1d01182
3 changed files with 14 additions and 1 deletions

View file

@ -51,6 +51,10 @@ module Ci
commit.try(:message)
end
def git_commit_title
commit.try(:title)
end
def short_sha
Ci::Pipeline.truncate_sha(sha)
end

View file

@ -96,7 +96,7 @@
.title
Commit title
%p.build-light-text.append-bottom-0
#{@build.pipeline.commit.try(:title)}
#{@build.pipeline.git_commit_title}
- if @build.tags.any?
.block

View file

@ -22,6 +22,10 @@ describe 'projects/builds/show' do
it 'does not show retry button' do
expect(rendered).not_to have_link('Retry')
end
it 'shows commit title' do
expect(rendered).to have_text(@git_commit_title)
end
end
context 'when build is not running' do
@ -33,5 +37,10 @@ describe 'projects/builds/show' do
it 'shows retry button' do
expect(rendered).to have_link('Retry')
end
it 'shows commit title' do
expect(rendered).to have_text(@git_commit_title)
end
end
end