Commit b9da1dbe authored by charlieablett's avatar charlieablett

Rename SpamCheckService to SpamCheckMethods

In order to reduce confusion since there
are multiple `Spam` services, and this
is a Concern, not a service

Move SpamCheckMethods to concerns
parent df64d5d2
# frozen_string_literal: true
# SpamCheckService
# SpamCheckMethods
#
# Provide helper methods for checking if a given spammable object has
# potential spam data.
#
# Dependencies:
# - params with :request
#
module SpamCheckService
module SpamCheckMethods
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def filter_spam_check_params
@request = params.delete(:request)
......
# frozen_string_literal: true
class CreateSnippetService < BaseService
include SpamCheckService
include SpamCheckMethods
def execute
filter_spam_check_params
......
......@@ -2,7 +2,7 @@
module Issues
class CreateService < Issues::BaseService
include SpamCheckService
include SpamCheckMethods
include ResolveDiscussions
def execute
......
......@@ -2,7 +2,7 @@
module Issues
class UpdateService < Issues::BaseService
include SpamCheckService
include SpamCheckMethods
def execute(issue)
handle_move_between_ids(issue)
......
# frozen_string_literal: true
class UpdateSnippetService < BaseService
include SpamCheckService
include SpamCheckMethods
attr_accessor :snippet
......
......@@ -45,7 +45,7 @@ describe SpamService do
context 'when indicated as spam by akismet' do
shared_examples 'akismet spam' do
it 'doesnt check as spam when request is missing' do
it "doesn't check as spam when request is missing" do
check_spam(issue, nil, false)
expect(issue).not_to be_spam
......
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