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 ...@@ -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 @@ ...@@ -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 ...@@ -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 ...@@ -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
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