From d20e75a8d80c2828336cd22897ea6868d666f8a5 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 9 Jan 2016 19:30:34 +0000 Subject: Support Akismet spam checking for creation of issues via API Currently any spam detected by Akismet by non-members via API will be logged in a separate table in the admin page. Closes #5612 --- features/steps/admin/spam_logs.rb | 18 ++++++++++++++++++ features/steps/shared/paths.rb | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 features/steps/admin/spam_logs.rb (limited to 'features/steps') diff --git a/features/steps/admin/spam_logs.rb b/features/steps/admin/spam_logs.rb new file mode 100644 index 00000000000..79d18b036b0 --- /dev/null +++ b/features/steps/admin/spam_logs.rb @@ -0,0 +1,18 @@ +class Spinach::Features::AdminSpamLogs < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedAdmin + + step 'I should see list of spam logs' do + page.should have_content("Spam Logs") + spam_log = SpamLog.first + page.should have_content spam_log.title + page.should have_content spam_log.description + page.should have_link("Remove user") + page.should have_link("Block user") + end + + step 'spam logs exist' do + create(:spam_log) + 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 -- cgit v1.2.3 From 64c9768bd6916edfc1e43907ca5e976524b8d51b Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Tue, 26 Jan 2016 16:59:23 -0200 Subject: Use truncate helper on spam logs list --- features/steps/admin/spam_logs.rb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'features/steps') diff --git a/features/steps/admin/spam_logs.rb b/features/steps/admin/spam_logs.rb index 79d18b036b0..ad825fd414c 100644 --- a/features/steps/admin/spam_logs.rb +++ b/features/steps/admin/spam_logs.rb @@ -4,15 +4,25 @@ class Spinach::Features::AdminSpamLogs < Spinach::FeatureSteps include SharedAdmin step 'I should see list of spam logs' do - page.should have_content("Spam Logs") - spam_log = SpamLog.first - page.should have_content spam_log.title - page.should have_content spam_log.description - page.should have_link("Remove user") - page.should have_link("Block user") + 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 -- cgit v1.2.3