Fix #4606: Add only= support for modqueue.
This commit is contained in:
@@ -23,6 +23,6 @@ class ModqueueController < ApplicationController
|
||||
|
||||
@preview_size = params[:size].presence || cookies[:post_preview_size].presence || PostPreviewComponent::DEFAULT_SIZE
|
||||
|
||||
respond_with(@posts)
|
||||
respond_with(@posts, model: "Post")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ class ModqueueControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@admin = create(:admin_user)
|
||||
@user = create(:user)
|
||||
@post = as(@user) { create(:post, is_pending: true) }
|
||||
@post = create(:post, is_pending: true)
|
||||
end
|
||||
|
||||
context "index action" do
|
||||
@@ -14,6 +14,18 @@ class ModqueueControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "render for a json response" do
|
||||
get_auth modqueue_index_path, @admin, as: :json
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "support the only= URL param" do
|
||||
get_auth modqueue_index_path(only: "rating"), @admin, as: :json
|
||||
|
||||
assert_response :success
|
||||
assert_equal([{ "rating" => @post.rating }], response.parsed_body)
|
||||
end
|
||||
|
||||
should "include appealed posts in the modqueue" do
|
||||
@appeal = create(:post_appeal)
|
||||
get_auth modqueue_index_path, @admin
|
||||
|
||||
Reference in New Issue
Block a user