Sha256: 91eea747834c80ca51a25545b8d9e4b80504a503bc924a9ac44e712fc71da079
Contents?: true
Size: 594 Bytes
Versions: 13
Compression:
Stored size: 594 Bytes
Contents
# -*- encoding : utf-8 -*- require 'test_helper' class PolymorphicAssociationTest < ActiveSupport::TestCase def setup @user = User.create :name => 'csdn', :email => 'test@csdn.com' end def test_should_get_cache_when_use_polymorphic_association image = @user.images.create @user.write_second_level_cache assert_no_queries do assert_equal @user, image.imagable end end def test_should_write_polymorphic_association_cache image = @user.images.create assert_nil User.read_second_level_cache(@user.id) assert_equal @user, image.imagable end end
Version data entries
13 entries across 13 versions & 1 rubygems