posts: fix error on post index page when search count times out in safe mode
Fix a nil deference error on the post index page. This happened when performing a single tag search in safe mode and calculating the number of search results timed out.
This commit is contained in:
@@ -234,6 +234,13 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response 410
|
||||
assert_select "h1", "Search Error"
|
||||
end
|
||||
|
||||
should "render if the search count times out" do
|
||||
PostQuery.any_instance.stubs(:exact_count).returns(nil)
|
||||
get posts_path, params: { tags: "1girl", safe_mode: "true" }
|
||||
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
context "with a pool: search" do
|
||||
|
||||
Reference in New Issue
Block a user