diff options
author | Robert Speicher <robert@gitlab.com> | 2016-02-03 04:26:30 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-02-03 04:26:30 +0300 |
commit | 8a85906a74aff295074c79619d491bea9c947e05 (patch) | |
tree | fc4aa22c44ce08a4bf6b823090e5c499b11ecc4a /features | |
parent | fcfafffef5535295e310407a7e3bb4a20ff2fd55 (diff) | |
parent | dffacbb12c0abd4edf677aed2d9e201b41fd2dae (diff) |
Merge branch 'support-akismet' into 'master'
Support Akismet spam checking for creation of issues via API
Currently any spam detected by Akismet for non-members via API will
be logged in a separate table in the admin page.
Closes #5612
See merge request !2266
Diffstat (limited to 'features')
-rw-r--r-- | features/admin/spam_logs.feature | 8 | ||||
-rw-r--r-- | features/steps/admin/spam_logs.rb | 28 | ||||
-rw-r--r-- | features/steps/shared/paths.rb | 4 |
3 files changed, 40 insertions, 0 deletions
diff --git a/features/admin/spam_logs.feature b/features/admin/spam_logs.feature new file mode 100644 index 00000000000..92a5389e3a4 --- /dev/null +++ b/features/admin/spam_logs.feature @@ -0,0 +1,8 @@ +Feature: Admin spam logs + Background: + Given I sign in as an admin + And spam logs exist + + Scenario: Browse spam logs + When I visit spam logs page + Then I should see list of spam logs diff --git a/features/steps/admin/spam_logs.rb b/features/steps/admin/spam_logs.rb new file mode 100644 index 00000000000..ad825fd414c --- /dev/null +++ b/features/steps/admin/spam_logs.rb @@ -0,0 +1,28 @@ +class Spinach::Features::AdminSpamLogs < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedAdmin + + step 'I should see list of spam logs' do + expect(page).to have_content('Spam Logs') + expect(page).to have_content spam_log.source_ip + expect(page).to have_content spam_log.noteable_type + expect(page).to have_content 'N' + expect(page).to have_content spam_log.title + expect(page).to have_content truncate(spam_log.description) + expect(page).to have_link('Remove user') + expect(page).to have_link('Block user') + end + + step 'spam logs exist' do + create(:spam_log) + end + + def spam_log + @spam_log ||= SpamLog.first + end + + def truncate(description) + "#{spam_log.description[0...97]}..." + end +end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 4264c9c6f1a..2c854ac7bf9 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -191,6 +191,10 @@ module SharedPaths visit admin_application_settings_path end + step 'I visit spam logs page' do + visit admin_spam_logs_path + end + step 'I visit applications page' do visit admin_applications_path end |