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

Rename Commits::UpdateService to Commits::TagService

parent 18611f0e
# 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]
......
......@@ -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)
......
require 'spec_helper'
describe Commits::UpdateService do
describe Commits::TagService do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
......
......@@ -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
......
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