summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Leitzen <pl@neopoly.de>2018-07-23 22:01:23 +0200
committerPeter Leitzen <pl@neopoly.de>2018-08-10 16:45:11 +0200
commit7405a7ae5fd9155ef90cc62988214135503eb99b (patch)
treebc5ae82eb4984ea7d4ec0c1abd29ae0d4ef3c6cc
parent18611f0eebe0bb3646c7f32bd333b92c184771eb (diff)
downloadgitlab-ce-7405a7ae5fd9155ef90cc62988214135503eb99b.tar.gz
Rename Commits::UpdateService to Commits::TagService
-rw-r--r--app/services/commits/tag_service.rb (renamed from app/services/commits/update_service.rb)8
-rw-r--r--app/services/notes/quick_actions_service.rb2
-rw-r--r--spec/services/commits/tag_service_spec.rb (renamed from spec/services/commits/update_service_spec.rb)2
-rw-r--r--spec/services/notes/quick_actions_service_spec.rb4
4 files changed, 5 insertions, 11 deletions
diff --git a/app/services/commits/update_service.rb b/app/services/commits/tag_service.rb
index 45c971d153a..0d361a3b77b 100644
--- a/app/services/commits/update_service.rb
+++ b/app/services/commits/tag_service.rb
@@ -1,14 +1,8 @@
# frozen_string_literal: true
module Commits
- class UpdateService < BaseService
+ class TagService < BaseService
def execute(commit)
- tag_commit(commit)
- end
-
- private
-
- def tag_commit(commit)
# TODO authorize
return unless params[:tag_name]
diff --git a/app/services/notes/quick_actions_service.rb b/app/services/notes/quick_actions_service.rb
index d183f280d77..4c14d834949 100644
--- a/app/services/notes/quick_actions_service.rb
+++ b/app/services/notes/quick_actions_service.rb
@@ -5,7 +5,7 @@ module Notes
UPDATE_SERVICES = {
'Issue' => Issues::UpdateService,
'MergeRequest' => MergeRequests::UpdateService,
- 'Commit' => Commits::UpdateService
+ 'Commit' => Commits::TagService
}.freeze
def self.noteable_update_service(note)
diff --git a/spec/services/commits/update_service_spec.rb b/spec/services/commits/tag_service_spec.rb
index b4f260096ad..5e778681544 100644
--- a/spec/services/commits/update_service_spec.rb
+++ b/spec/services/commits/tag_service_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Commits::UpdateService do
+describe Commits::TagService do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
diff --git a/spec/services/notes/quick_actions_service_spec.rb b/spec/services/notes/quick_actions_service_spec.rb
index b3ee0cadcb7..a8c994c101c 100644
--- a/spec/services/notes/quick_actions_service_spec.rb
+++ b/spec/services/notes/quick_actions_service_spec.rb
@@ -119,10 +119,10 @@ describe Notes::QuickActionsService do
expect(described_class.noteable_update_service(note)).to eq(MergeRequests::UpdateService)
end
- it 'returns Commits::UpdateService for a note on a commit' do
+ it 'returns Commits::TagService for a note on a commit' do
note = create(:note_on_commit, project: project)
- expect(described_class.noteable_update_service(note)).to eq(Commits::UpdateService)
+ expect(described_class.noteable_update_service(note)).to eq(Commits::TagService)
end
end