Commit 5f808958 authored by Peter Leitzen's avatar Peter Leitzen Committed by Sean McGivern

Rename Commits::UpdateService to Commits::TagService

parent a3766dd2
# 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