diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-03-30 11:10:07 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-30 16:01:53 +0200 |
commit | 37102a52373c368c1da18f916bfda1c4c4489fee (patch) | |
tree | f9e591b07ba602e69da83843236af0c71fda1085 /activerecord | |
parent | 8d99ec9a4dcef5918c4487a0d94ef0a9622fe8c9 (diff) | |
download | rails-37102a52373c368c1da18f916bfda1c4c4489fee.tar.gz rails-37102a52373c368c1da18f916bfda1c4c4489fee.tar.bz2 rails-37102a52373c368c1da18f916bfda1c4c4489fee.zip |
Fix failing test in MySQL.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/associations/belongs_to_associations_test.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index c57760d658..62121b93cb 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -34,8 +34,13 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase def test_belongs_to_with_primary_key_joins_on_correct_column sql = Client.joins(:firm_with_primary_key).to_sql - assert_no_match /"firm_with_primary_keys_companies"\."id"/, sql - assert_match /"firm_with_primary_keys_companies"\."name"/, sql + if current_adapter?(:MysqlAdapter) + assert_no_match /`firm_with_primary_keys_companies`\.`id`/, sql + assert_match /`firm_with_primary_keys_companies`\.`name`/, sql + else + assert_no_match /"firm_with_primary_keys_companies"\."id"/, sql + assert_match /"firm_with_primary_keys_companies"\."name"/, sql + end end def test_proxy_assignment @@ -457,7 +462,7 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase Author.belongs_to :special_author_address, :dependent => :nullify end end - + def test_invalid_belongs_to_dependent_option_restrict_raises_exception assert_raise ArgumentError do Author.belongs_to :special_author_address, :dependent => :restrict |