diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-01 12:14:03 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-08-15 13:18:15 -0500 |
commit | abf2dcd25c4a176801314872733ede91297d1ab0 (patch) | |
tree | 581aceab4c6a341bb6532145a1907ed4b9a25760 /spec | |
parent | 64ab2b3d9f10366249c03a6bcf5e8b1d20010d8f (diff) | |
download | gitlab-ce-abf2dcd25c4a176801314872733ede91297d1ab0.tar.gz |
Allow `SpamLog` to be submitted as ham
- Added `submitted_as_ham` to `SpamLog` to mark which logs have been submitted to Akismet.
- Added routes and controller action.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/concerns/spammable_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/models/concerns/spammable_spec.rb b/spec/models/concerns/spammable_spec.rb index 3f7d2721d22..7492c42f71e 100644 --- a/spec/models/concerns/spammable_spec.rb +++ b/spec/models/concerns/spammable_spec.rb @@ -45,10 +45,11 @@ describe Issue, 'Spammable' do describe 'AkismetMethods' do before do - allow_any_instance_of(Gitlab::AkismetHelper).to receive_messages(is_spam?: true, spam!: nil) + allow_any_instance_of(Gitlab::AkismetHelper).to receive_messages(is_spam?: true, spam!: true, akismet_enabled?: true) + allow_any_instance_of(Spammable).to receive(:can_be_submitted?).and_return(true) end it { expect(issue.spam_detected?(:mock_env)).to be_truthy } - it { expect(issue.submit_spam).to be_nil } + it { expect(issue.submit_spam).to be_truthy } end end |