Merge pull request #1003 from Rodrigora/fix-transient-test-failures

Fix transient test failures
This commit is contained in:
João Moura
2015-07-14 01:35:45 -04:00

View File

@@ -72,16 +72,19 @@ module ActiveModel
assert_equal(nil, ActionController::Base.cache_store.fetch(@post.cache_key))
assert_equal(nil, ActionController::Base.cache_store.fetch(@comment.cache_key))
Timecop.freeze(Time.now) do
post = render_object_with_cache(@post)
assert_equal(@post_serializer.attributes, ActionController::Base.cache_store.fetch(@post.cache_key))
assert_equal(@comment_serializer.attributes, ActionController::Base.cache_store.fetch(@comment.cache_key))
end
end
def test_associations_cache_when_updated
# Clean the Cache
ActionController::Base.cache_store.clear
Timecop.freeze(Time.now) do
# Generate a new Cache of Post object and each objects related to it.
render_object_with_cache(@post)
@@ -101,6 +104,7 @@ module ActiveModel
assert_equal(new_comment_serializer.attributes, ActionController::Base.cache_store.fetch(new_comment.cache_key))
assert_equal(@post_serializer.attributes, ActionController::Base.cache_store.fetch(@post.cache_key))
end
end
def test_fragment_fetch_with_virtual_associations
expected_result = {