Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3db405b06f
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (19 sloc) 0.617 kb
# -*- encoding : utf-8 -*-
require 'active_record/test_helper'
class ActiveRecord::PolymorphicAssociationTest < Test::Unit::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
no_connection do
assert_equal @user, image.imagable
end
end
def test_should_write_polymorphic_association_cache
image = @user.images.create
@user.expire_second_level_cache
assert_nil User.read_second_level_cache(@user.id)
assert_equal @user, image.imagable
end
end
Jump to Line
Something went wrong with that request. Please try again.