From 4a392473d8140ee47c9e6cc15cff7550730e94ac Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Wed, 16 Sep 2015 23:34:01 -0500 Subject: [PATCH] Fix appveyor failure on cache expiration --- test/action_controller/serialization_test.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/action_controller/serialization_test.rb b/test/action_controller/serialization_test.rb index 79d7c037b..f8af66d8d 100644 --- a/test/action_controller/serialization_test.rb +++ b/test/action_controller/serialization_test.rb @@ -78,8 +78,15 @@ def render_object_expired_with_cache_enabled generate_cached_serializer(post) post.title = 'ZOMG a New Post' - sleep 0.1 - render json: post + + expires_in = [ + PostSerializer._cache_options[:expires_in], + CommentSerializer._cache_options[:expires_in], + ].max + + Timecop.travel(Time.zone.now + expires_in) do + render json: post + end end def render_changed_object_with_cache_enabled