From f4c103a42244d803dcea7e1bbde66965836373a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Strza=C5=82kowski?= Date: Wed, 5 May 2010 22:12:51 +0200 Subject: [PATCH] Better test for belongs_to with primary key --- .../associations/belongs_to_associations_test.rb | 5 ++--- 1 files changed, 2 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 ab0edee..87f541d 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -32,9 +32,8 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase end def test_belongs_to_with_primary_key_joins_on_correct_column - sql = Client.send(:construct_finder_sql, :joins => :firm_with_primary_key) - assert sql !~ /\.id/ - assert sql =~ /\.name/ + assert_equal Client.first(:joins => :firm).firm_name, nil + assert_equal Client.first(:joins => :firm_with_primary_key).firm_name, "37signals" end def test_proxy_assignment -- 1.6.6.1