Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 15:07:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 15:07:40 +0300
commit506d6dcd7c787ba71a8a53102f3d4fdb6adcfa5e (patch)
treeb1d65f48256b1f17d6f47429a65050c5d43f420a /spec/services/spam
parent45b4df3e57c949c88107840c44ccbfaf2eabdf26 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/spam')
-rw-r--r--spec/services/spam/spam_check_service_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/services/spam/spam_check_service_spec.rb b/spec/services/spam/spam_check_service_spec.rb
index 8ae6764c5d5..cb13465b825 100644
--- a/spec/services/spam/spam_check_service_spec.rb
+++ b/spec/services/spam/spam_check_service_spec.rb
@@ -49,6 +49,25 @@ describe Spam::SpamCheckService do
end
end
+ shared_examples 'akismet spam' do
+ context 'when request is missing' do
+ let(:request) { nil }
+
+ it "doesn't check as spam" do
+ subject
+
+ expect(issue).not_to be_spam
+ end
+ end
+
+ context 'when request exists' do
+ it 'creates a spam log' do
+ expect { subject }
+ .to log_spam(title: issue.title, description: issue.description, noteable_type: 'Issue')
+ end
+ end
+ end
+
describe '#execute' do
let(:request) { double(:request, env: env) }