throw error on counts/posts endpoint during a timeout (#2170)

This commit is contained in:
Albert Yi
2018-09-19 13:34:50 -07:00
parent 2f17082e73
commit ed5b2ad443
3 changed files with 13 additions and 1 deletions

View File

@@ -7,6 +7,12 @@ class CountsControllerTest < ActionDispatch::IntegrationTest
get posts_counts_path
assert_response :success
end
should "render an error during a timeout" do
Post.stubs(:fast_count).raises(Post::TimeoutError.new)
get posts_counts_path
assert_response :error
end
end
end
end