add git-commit-title-method into pipeline model and modify view
add git-commit-title-method into tests
This commit is contained in:
parent
af1a6f0533
commit
fda1d01182
3 changed files with 14 additions and 1 deletions
|
@ -51,6 +51,10 @@ module Ci
|
||||||
commit.try(:message)
|
commit.try(:message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def git_commit_title
|
||||||
|
commit.try(:title)
|
||||||
|
end
|
||||||
|
|
||||||
def short_sha
|
def short_sha
|
||||||
Ci::Pipeline.truncate_sha(sha)
|
Ci::Pipeline.truncate_sha(sha)
|
||||||
end
|
end
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
.title
|
.title
|
||||||
Commit title
|
Commit title
|
||||||
%p.build-light-text.append-bottom-0
|
%p.build-light-text.append-bottom-0
|
||||||
#{@build.pipeline.commit.try(:title)}
|
#{@build.pipeline.git_commit_title}
|
||||||
|
|
||||||
- if @build.tags.any?
|
- if @build.tags.any?
|
||||||
.block
|
.block
|
||||||
|
|
|
@ -22,6 +22,10 @@ describe 'projects/builds/show' do
|
||||||
it 'does not show retry button' do
|
it 'does not show retry button' do
|
||||||
expect(rendered).not_to have_link('Retry')
|
expect(rendered).not_to have_link('Retry')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'shows commit title' do
|
||||||
|
expect(rendered).to have_text(@git_commit_title)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when build is not running' do
|
context 'when build is not running' do
|
||||||
|
@ -33,5 +37,10 @@ describe 'projects/builds/show' do
|
||||||
it 'shows retry button' do
|
it 'shows retry button' do
|
||||||
expect(rendered).to have_link('Retry')
|
expect(rendered).to have_link('Retry')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'shows commit title' do
|
||||||
|
expect(rendered).to have_text(@git_commit_title)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue