From 506d6dcd7c787ba71a8a53102f3d4fdb6adcfa5e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 30 Mar 2020 12:07:40 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/services/spam/spam_check_service_spec.rb | 19 +++++++++++++++++++ .../shared_examples/spam_check_shared_examples.rb | 20 -------------------- 2 files changed, 19 insertions(+), 20 deletions(-) delete mode 100644 spec/support/shared_examples/spam_check_shared_examples.rb (limited to 'spec') 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) } diff --git a/spec/support/shared_examples/spam_check_shared_examples.rb b/spec/support/shared_examples/spam_check_shared_examples.rb deleted file mode 100644 index 3ecae16db39..00000000000 --- a/spec/support/shared_examples/spam_check_shared_examples.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -shared_examples 'akismet spam' do - context 'when request is missing' do - subject { described_class.new(spammable: issue, 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 -- cgit v1.2.1