Sha256: de92aa1d412a46b97cf9103c334f1bd833ca95dc9444f10c51d8e0c2ead9297f

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

# -*- 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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
second_level_cache-1.3.2 test/active_record/polymorphic_association_test.rb