Sha256: d949f3f0761c549efc40ae8680fde9d7a26eb5f1997868c2778912e10b9f363c

Contents?: true

Size: 577 Bytes

Versions: 8

Compression:

Stored size: 577 Bytes

Contents

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

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

  def test_should_get_cache_key
    assert_equal "slc/user/#{@user.id}/#{User::CacheVersion}", @user.second_level_cache_key
  end

  def test_should_write_and_read_cache
    @user.write_second_level_cache
    assert_not_nil User.read_second_level_cache(@user.id)
    @user.expire_second_level_cache
    assert_nil User.read_second_level_cache(@user.id)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
second_level_cache-2.0.0 test/active_record/second_level_cache_test.rb
second_level_cache-2.0.0.rc1 test/active_record/second_level_cache_test.rb
second_level_cache-2.0.0.beta test/active_record/second_level_cache_test.rb
second_level_cache-1.6.2 test/active_record/second_level_cache_test.rb
second_level_cache-1.6.1 test/active_record/second_level_cache_test.rb
second_level_cache-1.6.0 test/active_record/second_level_cache_test.rb
second_level_cache-1.5.1 test/active_record/second_level_cache_test.rb
second_level_cache-1.5.0 test/active_record/second_level_cache_test.rb