Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
394107f5
Commit
394107f5
authored
Jul 23, 2018
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link to the tag in system note
parent
7405a7ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
app/services/system_note_service.rb
app/services/system_note_service.rb
+2
-1
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+4
-2
No files found.
app/services/system_note_service.rb
View file @
394107f5
...
@@ -41,7 +41,8 @@ module SystemNoteService
...
@@ -41,7 +41,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
...
...
spec/services/system_note_service_spec.rb
View file @
394107f5
...
@@ -112,7 +112,7 @@ describe SystemNoteService do
...
@@ -112,7 +112,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
)
{
'
v
1.2.3'
}
subject
{
described_class
.
tag_commit
(
noteable
,
project
,
author
,
tag_name
)
}
subject
{
described_class
.
tag_commit
(
noteable
,
project
,
author
,
tag_name
)
}
...
@@ -121,7 +121,9 @@ describe SystemNoteService do
...
@@ -121,7 +121,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment