Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-02-17 02:50:52 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2017-02-17 02:50:52 +0300
commit416b94f27e84aa2ef5aa61fea58b2bd64a44ac99 (patch)
tree93bb3e07ab53d4c683ba9bb0771e6afbe9cd71dc
parentcee957f56c60649949da72a9ea01b2f6e7b0eb56 (diff)
parentae69e8764c273029ed944e98842a21a4aab0f4af (diff)
Merge branch '28059-add-pagination-to-admin-abuse-reports' into 'master'
Restore pagination to admin abuse reports Closes #28059 See merge request !9233
-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..6c48328da4f 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, theme: 'gitlab'
- 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