Commit 394107f5 authored by Peter Leitzen's avatar Peter Leitzen

Link to the tag in system note

parent 7405a7ae
......@@ -41,7 +41,8 @@ module SystemNoteService
#
# Returns the created Note object
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'))
end
......
......@@ -112,7 +112,7 @@ describe SystemNoteService do
let(:noteable) do
project.commit
end
let(:tag_name) { '1.2.3' }
let(:tag_name) { 'v1.2.3' }
subject { described_class.tag_commit(noteable, project, author, tag_name) }
......@@ -121,7 +121,9 @@ describe SystemNoteService do
end
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
......
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