modreports: allow users to see modreports they've submitted.

This commit is contained in:
evazion
2021-01-16 01:31:36 -06:00
parent e7cdae33b2
commit 50a75e2ec5
4 changed files with 27 additions and 8 deletions

View File

@@ -34,9 +34,21 @@ class ModerationReportsControllerTest < ActionDispatch::IntegrationTest
end
context "as a user" do
should "render the access denied page" do
should "show reports submitted by the current user" do
get_auth moderation_reports_path, @user
assert_response 403
assert_response :success
assert_select "tbody tr", count: 2
assert_select "tr#moderation-report-#{@comment_report.id}", count: 1
assert_select "tr#moderation-report-#{@forum_report.id}", count: 1
assert_select "tr#moderation-report-#{@dmail_report.id}", count: 0
end
should "not show reports submitted by other users" do
get_auth moderation_reports_path, create(:user)
assert_response :success
assert_select "tbody tr", count: 0
end
end