Sha256: e47a1da42a8b411d750cadaa90a0ef188711dc6d7dbb0ef5db4169c765fd04a3

Contents?: true

Size: 604 Bytes

Versions: 1

Compression:

Stored size: 604 Bytes

Contents

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

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

  def test_should_find_without_cache
    SecondLevelCache.cache_store.clear
    assert_equal @user, User.find(@user.id)
  end

  def test_should_find_with_cache
    no_connection do
      assert_equal @user, User.find(@user.id)
    end
  end

  def test_should_find_with_condition
    no_connection do
      assert_equal @user, User.where(:name => @user.name).find(@user.id)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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