diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-09 03:23:37 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-09 03:23:37 +0000 |
commit | 98165fd31e7be605ef37e096e8423ce8953ef4ed (patch) | |
tree | 840b6c9948d84297190addc12b50ffd06d8dca50 /activerecord/test/pk_test.rb | |
parent | 49d1f6a813c2791f150611df1229593306796871 (diff) | |
download | rails-98165fd31e7be605ef37e096e8423ce8953ef4ed.tar.gz rails-98165fd31e7be605ef37e096e8423ce8953ef4ed.tar.bz2 rails-98165fd31e7be605ef37e096e8423ce8953ef4ed.zip |
Consistently quote primary key column names. Closes #7763.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6364 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/pk_test.rb')
-rw-r--r-- | activerecord/test/pk_test.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/activerecord/test/pk_test.rb b/activerecord/test/pk_test.rb index 604b263571..4daef43062 100644 --- a/activerecord/test/pk_test.rb +++ b/activerecord/test/pk_test.rb @@ -4,9 +4,10 @@ require 'fixtures/reply' require 'fixtures/subscriber' require 'fixtures/movie' require 'fixtures/keyboard' +require 'fixtures/mixed_case_monkey' class PrimaryKeysTest < Test::Unit::TestCase - fixtures :topics, :subscribers, :movies + fixtures :topics, :subscribers, :movies, :mixed_case_monkeys def test_integer_key topic = Topic.find(1) @@ -78,4 +79,23 @@ class PrimaryKeysTest < Test::Unit::TestCase Topic.reset_primary_key assert_equal "id", Topic.primary_key end + + def test_delete_should_quote_pkey + assert_nothing_raised { MixedCaseMonkey.delete(1) } + end + def test_update_counters_should_quote_pkey_and_quote_counter_columns + assert_nothing_raised { MixedCaseMonkey.update_counters(1, :fleaCount => 99) } + end + def test_find_with_one_id_should_quote_pkey + assert_nothing_raised { MixedCaseMonkey.find(1) } + end + def test_find_with_multiple_ids_should_quote_pkey + assert_nothing_raised { MixedCaseMonkey.find([1,2]) } + end + def test_instance_update_should_quote_pkey + assert_nothing_raised { MixedCaseMonkey.find(1).save } + end + def test_instance_destry_should_quote_pkey + assert_nothing_raised { MixedCaseMonkey.find(1).destroy } + end end |