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
Léo-Paul Géneau
gitlab-ce
Commits
7405a7ae
Commit
7405a7ae
authored
Jul 23, 2018
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Commits::UpdateService to Commits::TagService
parent
18611f0e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
11 deletions
+5
-11
app/services/commits/tag_service.rb
app/services/commits/tag_service.rb
+1
-7
app/services/notes/quick_actions_service.rb
app/services/notes/quick_actions_service.rb
+1
-1
spec/services/commits/tag_service_spec.rb
spec/services/commits/tag_service_spec.rb
+1
-1
spec/services/notes/quick_actions_service_spec.rb
spec/services/notes/quick_actions_service_spec.rb
+2
-2
No files found.
app/services/commits/
update
_service.rb
→
app/services/commits/
tag
_service.rb
View file @
7405a7ae
# frozen_string_literal: true
module
Commits
class
Update
Service
<
BaseService
class
Tag
Service
<
BaseService
def
execute
(
commit
)
tag_commit
(
commit
)
end
private
def
tag_commit
(
commit
)
# TODO authorize
return
unless
params
[
:tag_name
]
...
...
app/services/notes/quick_actions_service.rb
View file @
7405a7ae
...
...
@@ -5,7 +5,7 @@ module Notes
UPDATE_SERVICES
=
{
'Issue'
=>
Issues
::
UpdateService
,
'MergeRequest'
=>
MergeRequests
::
UpdateService
,
'Commit'
=>
Commits
::
Update
Service
'Commit'
=>
Commits
::
Tag
Service
}.
freeze
def
self
.
noteable_update_service
(
note
)
...
...
spec/services/commits/
update
_service_spec.rb
→
spec/services/commits/
tag
_service_spec.rb
View file @
7405a7ae
require
'spec_helper'
describe
Commits
::
Update
Service
do
describe
Commits
::
Tag
Service
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
spec/services/notes/quick_actions_service_spec.rb
View file @
7405a7ae
...
...
@@ -119,10 +119,10 @@ describe Notes::QuickActionsService do
expect
(
described_class
.
noteable_update_service
(
note
)).
to
eq
(
MergeRequests
::
UpdateService
)
end
it
'returns Commits::
Update
Service for a note on a commit'
do
it
'returns Commits::
Tag
Service for a note on a commit'
do
note
=
create
(
:note_on_commit
,
project:
project
)
expect
(
described_class
.
noteable_update_service
(
note
)).
to
eq
(
Commits
::
Update
Service
)
expect
(
described_class
.
noteable_update_service
(
note
)).
to
eq
(
Commits
::
Tag
Service
)
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