Add error pages for tag limit and pagination errors.

This commit is contained in:
evazion
2019-09-09 17:19:24 -05:00
parent 62b89e1f9a
commit 347aa4b835
6 changed files with 50 additions and 4 deletions

View File

@@ -66,6 +66,20 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
get posts_path, params: {:tags => "1girl solo"}
assert_response :success
end
should "render an error when searching for too many tags" do
get posts_path, params: { tags: "1 2 3" }
assert_response 422
assert_select "h1", "Search Error"
end
should "render an error when exceeding the page limit" do
get posts_path, params: { page: 1001 }
assert_response 410
assert_select "h1", "Search Error"
end
end
context "with an md5 param" do