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