Link to the tag in system note
This commit is contained in:
parent
7405a7ae5f
commit
394107f5f6
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue