Commit a59f0d58 authored by Peter Leitzen's avatar Peter Leitzen Committed by Sean McGivern

Link to the tag in system note

parent 5f808958
...@@ -42,7 +42,8 @@ module SystemNoteService ...@@ -42,7 +42,8 @@ module SystemNoteService
# #
# Returns the created Note object # Returns the created Note object
def tag_commit(noteable, project, author, tag_name) def tag_commit(noteable, project, author, tag_name)
body = "tagged commit #{noteable.sha} to `#{tag_name}`" link = url_helpers.project_tag_url(project, id: tag_name)
body = "tagged commit #{noteable.sha} to [`#{tag_name}`](#{link})"
create_note(NoteSummary.new(noteable, project, author, body, action: 'tag')) create_note(NoteSummary.new(noteable, project, author, body, action: 'tag'))
end end
......
...@@ -114,7 +114,7 @@ describe SystemNoteService do ...@@ -114,7 +114,7 @@ describe SystemNoteService do
let(:noteable) do let(:noteable) do
project.commit project.commit
end end
let(:tag_name) { '1.2.3' } let(:tag_name) { 'v1.2.3' }
subject { described_class.tag_commit(noteable, project, author, tag_name) } subject { described_class.tag_commit(noteable, project, author, tag_name) }
...@@ -123,7 +123,9 @@ describe SystemNoteService do ...@@ -123,7 +123,9 @@ describe SystemNoteService do
end end
it 'sets the note text' do it 'sets the note text' do
expect(subject.note).to eq "tagged commit #{noteable.sha} to `#{tag_name}`" link = "http://localhost/#{project.full_path}/tags/#{tag_name}"
expect(subject.note).to eq "tagged commit #{noteable.sha} to [`#{tag_name}`](#{link})"
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