From 37102a52373c368c1da18f916bfda1c4c4489fee Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Tue, 30 Mar 2010 11:10:07 -0300 Subject: Fix failing test in MySQL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- .../test/cases/associations/belongs_to_associations_test.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'activerecord/test/cases') 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 -- cgit v1.2.3