Commit 7405a7ae authored by Peter Leitzen's avatar Peter Leitzen

Rename Commits::UpdateService to Commits::TagService

parent 18611f0e
# frozen_string_literal: true # frozen_string_literal: true
module Commits module Commits
class UpdateService < BaseService class TagService < BaseService
def execute(commit) def execute(commit)
tag_commit(commit)
end
private
def tag_commit(commit)
# TODO authorize # TODO authorize
return unless params[:tag_name] return unless params[:tag_name]
......
...@@ -5,7 +5,7 @@ module Notes ...@@ -5,7 +5,7 @@ module Notes
UPDATE_SERVICES = { UPDATE_SERVICES = {
'Issue' => Issues::UpdateService, 'Issue' => Issues::UpdateService,
'MergeRequest' => MergeRequests::UpdateService, 'MergeRequest' => MergeRequests::UpdateService,
'Commit' => Commits::UpdateService 'Commit' => Commits::TagService
}.freeze }.freeze
def self.noteable_update_service(note) def self.noteable_update_service(note)
......
require 'spec_helper' require 'spec_helper'
describe Commits::UpdateService do describe Commits::TagService do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -119,10 +119,10 @@ describe Notes::QuickActionsService do ...@@ -119,10 +119,10 @@ describe Notes::QuickActionsService do
expect(described_class.noteable_update_service(note)).to eq(MergeRequests::UpdateService) expect(described_class.noteable_update_service(note)).to eq(MergeRequests::UpdateService)
end 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) 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
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