Sha256: 36bdcc5818130a2fb134fc2c04073df62e3c8ba4547a7ab4fd3d72f27e46d90f
Contents?: true
Size: 592 Bytes
Versions: 15
Compression:
Stored size: 592 Bytes
Contents
# frozen_string_literal: true 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
15 entries across 15 versions & 1 rubygems