mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06:50 +00:00
Merge pull request #1003 from Rodrigora/fix-transient-test-failures
Fix transient test failures
This commit is contained in:
commit
954e4c51fe
@ -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(@post.cache_key))
|
||||||
assert_equal(nil, ActionController::Base.cache_store.fetch(@comment.cache_key))
|
assert_equal(nil, ActionController::Base.cache_store.fetch(@comment.cache_key))
|
||||||
|
|
||||||
|
Timecop.freeze(Time.now) do
|
||||||
post = render_object_with_cache(@post)
|
post = render_object_with_cache(@post)
|
||||||
|
|
||||||
assert_equal(@post_serializer.attributes, ActionController::Base.cache_store.fetch(@post.cache_key))
|
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))
|
assert_equal(@comment_serializer.attributes, ActionController::Base.cache_store.fetch(@comment.cache_key))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_associations_cache_when_updated
|
def test_associations_cache_when_updated
|
||||||
# Clean the Cache
|
# Clean the Cache
|
||||||
ActionController::Base.cache_store.clear
|
ActionController::Base.cache_store.clear
|
||||||
|
|
||||||
|
Timecop.freeze(Time.now) do
|
||||||
# Generate a new Cache of Post object and each objects related to it.
|
# Generate a new Cache of Post object and each objects related to it.
|
||||||
render_object_with_cache(@post)
|
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(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))
|
assert_equal(@post_serializer.attributes, ActionController::Base.cache_store.fetch(@post.cache_key))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_fragment_fetch_with_virtual_associations
|
def test_fragment_fetch_with_virtual_associations
|
||||||
expected_result = {
|
expected_result = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user