summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-02-14 10:16:24 -0600
committerEric Eastwood <contact@ericeastwood.com>2017-02-15 16:53:53 -0600
commit67797ac52b2f1eca005aa8aee98c0f4c881738ab (patch)
tree783caa86e84007baf9716e3a452aefea5610c8b6
parent1452729304393978ec93b712130dff6687db01b9 (diff)
downloadgitlab-ce-28059-add-pagination-to-admin-abuse-reports.tar.gz
Restore pagination to admin abuse reports28059-add-pagination-to-admin-abuse-reports
-rw-r--r--app/views/admin/abuse_reports/index.html.haml1
-rw-r--r--changelogs/unreleased/28059-add-pagination-to-admin-abuse-reports.yml4
-rw-r--r--spec/features/admin/admin_abuse_reports_spec.rb19
3 files changed, 24 insertions, 0 deletions
diff --git a/app/views/admin/abuse_reports/index.html.haml b/app/views/admin/abuse_reports/index.html.haml
index c4b748d0ab8..78bb5e3f65c 100644
--- a/app/views/admin/abuse_reports/index.html.haml
+++ b/app/views/admin/abuse_reports/index.html.haml
@@ -12,6 +12,7 @@
%th.wide Message
%th Action
= render @abuse_reports
+ = paginate @abuse_reports
- else
.empty-state
.text-center
diff --git a/changelogs/unreleased/28059-add-pagination-to-admin-abuse-reports.yml b/changelogs/unreleased/28059-add-pagination-to-admin-abuse-reports.yml
new file mode 100644
index 00000000000..1b2e678bbed
--- /dev/null
+++ b/changelogs/unreleased/28059-add-pagination-to-admin-abuse-reports.yml
@@ -0,0 +1,4 @@
+---
+title: Restore pagination to admin abuse reports
+merge_request:
+author:
diff --git a/spec/features/admin/admin_abuse_reports_spec.rb b/spec/features/admin/admin_abuse_reports_spec.rb
index 7fcfe5a54c7..340884fc986 100644
--- a/spec/features/admin/admin_abuse_reports_spec.rb
+++ b/spec/features/admin/admin_abuse_reports_spec.rb
@@ -30,5 +30,24 @@ describe "Admin::AbuseReports", feature: true, js: true do
end
end
end
+
+ describe 'if a many users have been reported for abuse' do
+ let(:report_count) { AbuseReport.default_per_page + 3 }
+
+ before do
+ report_count.times do
+ create(:abuse_report, user: create(:user))
+ end
+ end
+
+ describe 'in the abuse report view' do
+ it 'presents information about abuse report' do
+ visit admin_abuse_reports_path
+
+ expect(page).to have_selector('.pagination')
+ expect(page).to have_selector('.pagination .page', count: (report_count.to_f / AbuseReport.default_per_page).ceil)
+ end
+ end
+ end
end
end