Commit fda1d011 authored by ubudzisz's avatar ubudzisz

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

add git-commit-title-method into tests
parent af1a6f05
......@@ -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
......
......@@ -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
......
......@@ -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
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