Sha256: c98500930e50b60db7d6a0452d8d5c24a7582c4c16544e280e3e8738a40fc2db

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'active_record/test_helper'

class ActiveRecord::BelongsToAssociationTest < Test::Unit::TestCase
  def setup
    @user = User.create :name => 'csdn', :email => 'test@csdn.com'
  end

  def test_should_get_cache_when_use_belongs_to_association
    book = @user.books.create

    no_connection do
      assert_equal @user, book.user
    end
  end

  def test_should_write_belongs_to_association_cache
    book = @user.books.create
    @user.expire_second_level_cache
    assert_nil User.read_second_level_cache(@user.id)
    assert_equal @user, book.user
    # assert_not_nil User.read_second_level_cache(@user.id)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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