posts index: clean up limit:<n> / order:random parsing (#2894)

* Move the limit:<n> / order:random metatag parsing from the controller
  to the post set.

* Introduce `Tag.has_metatag?` and use it to parse these metatags
  instead of using a regex (#2894).
This commit is contained in:
evazion
2018-09-20 12:57:43 -05:00
parent 235271706b
commit 6fe883c316
6 changed files with 44 additions and 8 deletions

View File

@@ -89,6 +89,16 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
assert_redirected_to(@post)
end
end
context "with a random search" do
should "render" do
get posts_path, params: { tags: "order:random" }
assert_response :success
get posts_path, params: { random: "1" }
assert_response :success
end
end
end
context "show_seq action" do