Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (17 sloc) 613 Bytes
# -*- 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.second_level_cache_key
end
def test_should_write_and_read_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)
@user.write_second_level_cache
assert_not_nil User.read_second_level_cache(@user.id)
end
end
Something went wrong with that request. Please try again.