diff options
author | Mohammad El-Abid <mohammad.elabid@gmail.com> | 2011-05-26 00:54:51 -0400 |
---|---|---|
committer | Mohammad El-Abid <mohammad.elabid@gmail.com> | 2011-05-26 00:54:51 -0400 |
commit | ec44763f03b49e8c6e3bff71772ba32863a01306 (patch) | |
tree | c48304d17a201ba3c5d4b86af9caf08cebe669a6 /activerecord/test | |
parent | bf9272b9d42656efc2fd935c6a4108c8e0f306d0 (diff) | |
download | rails-ec44763f03b49e8c6e3bff71772ba32863a01306.tar.gz rails-ec44763f03b49e8c6e3bff71772ba32863a01306.tar.bz2 rails-ec44763f03b49e8c6e3bff71772ba32863a01306.zip |
Removes the restriction on primary key when joining in a habtm && test that it was properly removed
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/habtm_join_table_test.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/activerecord/test/cases/associations/habtm_join_table_test.rb b/activerecord/test/cases/associations/habtm_join_table_test.rb index 745f169ad7..85bb7d57bb 100644 --- a/activerecord/test/cases/associations/habtm_join_table_test.rb +++ b/activerecord/test/cases/associations/habtm_join_table_test.rb @@ -33,12 +33,11 @@ class HabtmJoinTableTest < ActiveRecord::TestCase ActiveRecord::Base.connection.drop_table :my_books_my_readers end - uses_transaction :test_should_raise_exception_when_join_table_has_a_primary_key - def test_should_raise_exception_when_join_table_has_a_primary_key + uses_transaction :test_should_not_raise_exception_when_join_table_has_a_primary_key + def test_should_not_raise_exception_when_join_table_has_a_primary_key if ActiveRecord::Base.connection.supports_primary_key? - assert_raise ActiveRecord::HasAndBelongsToManyAssociationWithPrimaryKeyError do - MyReader.has_and_belongs_to_many :my_books - end + # This test is to confirm that this feature is now gone + assert MyReader.has_and_belongs_to_many(:my_books).is_a?(ActiveRecord::Reflection::AssociationReflection) end end end |