diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 5 | ||||
-rw-r--r-- | activerecord/test/cases/connection_pool_test.rb | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 1730d9fb56..20a16cc8ac 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -50,6 +50,11 @@ class Boolean < ActiveRecord::Base; end class BasicsTest < ActiveRecord::TestCase fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors, :categorizations, :categories, :posts + def test_columns_should_obey_set_primary_key + pk = Subscriber.columns.find { |x| x.name == 'nick' } + assert pk.primary, 'nick should be primary key' + end + def test_primary_key_with_no_id assert_nil Edge.primary_key end diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb index 55ac1bc406..0c545b7e9d 100644 --- a/activerecord/test/cases/connection_pool_test.rb +++ b/activerecord/test/cases/connection_pool_test.rb @@ -18,16 +18,14 @@ module ActiveRecord assert_equal columns_hash, @pool.columns_hash['posts'] end - def test_clearing_cache + def test_clearing_column_cache @pool.columns['posts'] @pool.columns_hash['posts'] - @pool.primary_keys['posts'] @pool.clear_cache! assert_equal 0, @pool.columns.size assert_equal 0, @pool.columns_hash.size - assert_equal 0, @pool.primary_keys.size end def test_primary_key |