diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-02 16:21:57 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-08-15 13:18:15 -0500 |
commit | 96399a81cbb2e8a0f666241eeaff7cc784c26983 (patch) | |
tree | 7123e352717a846300c031cb884028fbd0a7f1d3 /spec/controllers/admin/spam_logs_controller_spec.rb | |
parent | abf2dcd25c4a176801314872733ede91297d1ab0 (diff) | |
download | gitlab-ce-96399a81cbb2e8a0f666241eeaff7cc784c26983.tar.gz |
Allow `Issue` to be submitted as spam
- Added controller actions as reusable concerns
- Added controller tests
Diffstat (limited to 'spec/controllers/admin/spam_logs_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin/spam_logs_controller_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/admin/spam_logs_controller_spec.rb b/spec/controllers/admin/spam_logs_controller_spec.rb index 520a4f6f9c5..f94afd1139d 100644 --- a/spec/controllers/admin/spam_logs_controller_spec.rb +++ b/spec/controllers/admin/spam_logs_controller_spec.rb @@ -34,4 +34,16 @@ describe Admin::SpamLogsController do expect { User.find(user.id) }.to raise_error(ActiveRecord::RecordNotFound) end end + + describe '#mark_as_ham' do + before do + allow_any_instance_of(Gitlab::AkismetHelper).to receive(:ham!).and_return(true) + end + it 'submits the log as ham' do + post :mark_as_ham, id: first_spam.id + + expect(response).to have_http_status(302) + expect(SpamLog.find(first_spam.id).submitted_as_ham).to be_truthy + end + end end |