summaryrefslogtreecommitdiff
path: root/features/steps/admin
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-01-26 16:59:23 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-02 11:25:44 -0200
commit64c9768bd6916edfc1e43907ca5e976524b8d51b (patch)
tree850ea9b5a7ac5178555f817d27402647df5e4b0b /features/steps/admin
parentd20e75a8d80c2828336cd22897ea6868d666f8a5 (diff)
downloadgitlab-ce-64c9768bd6916edfc1e43907ca5e976524b8d51b.tar.gz
Use truncate helper on spam logs list
Diffstat (limited to 'features/steps/admin')
-rw-r--r--features/steps/admin/spam_logs.rb22
1 files changed, 16 insertions, 6 deletions
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