mod actions: add options to filter /mod_actions by subject.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
FactoryBot.define do
|
||||
factory(:mod_action) do
|
||||
creator :factory => :user
|
||||
description {"1234"}
|
||||
category {"other"}
|
||||
creator factory: :user
|
||||
subject factory: :post
|
||||
description { "undeleted post ##{subject_id}" }
|
||||
category { "post_undelete" }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -60,6 +60,26 @@ class IpBansControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
end
|
||||
|
||||
context "show action" do
|
||||
should "redirect for html" do
|
||||
get_auth ip_ban_path(@ip_ban), @admin
|
||||
|
||||
assert_redirected_to ip_bans_path(search: { id: @ip_ban.id })
|
||||
end
|
||||
|
||||
should "render for json" do
|
||||
get_auth ip_ban_path(@ip_ban), @admin, as: :json
|
||||
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "render 403 for an unauthorized user" do
|
||||
get ip_ban_path(@ip_ban)
|
||||
|
||||
assert_response 403
|
||||
end
|
||||
end
|
||||
|
||||
context "update action" do
|
||||
should "mark an ip ban as deleted" do
|
||||
put_auth ip_ban_path(@ip_ban), @admin, params: { ip_ban: { is_deleted: true }, format: "js" }
|
||||
|
||||
Reference in New Issue
Block a user