summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/spam_check_shared_examples.rb
blob: 3ecae16db39b0d70c943858eac215f36b7621775 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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