Fix #5267: order[custom] no longer works when only a single ID is being searched

This commit is contained in:
evazion
2022-09-29 03:36:55 -05:00
parent 530d8cf762
commit d629c81aa1
3 changed files with 11 additions and 2 deletions

View File

@@ -334,6 +334,14 @@ class ApplicationControllerTest < ActionDispatch::IntegrationTest
assert_equal(0, response.parsed_body.size)
end
should "work if the search[order]=custom param is used with a single id" do
tags = create_list(:tag, 2, post_count: 42)
get tags_path, params: { search: { id: tags[0].id, order: "custom" } }, as: :json
assert_response :success
assert_equal([tags[0].id], response.parsed_body.pluck("id"))
end
should "support the expiry parameter" do
get posts_path, as: :json, params: { expiry: "1" }