From e4aec40578ea0dd2944f97f1ad60cfbdf4b3a44d Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 28 Nov 2018 03:34:20 +0900 Subject: More exercise singular association query Follow up ba4e68f577efc76f351d30a2914e29942b97830e. --- .../test/cases/associations/belongs_to_associations_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activerecord/test/cases/associations/belongs_to_associations_test.rb') diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index c1a335bda8..d1e4ebe86b 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -33,10 +33,10 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase def test_belongs_to client = Client.find(3) + first_firm = companies(:first_firm) assert_sql(/LIMIT|ROWNUM <=|FETCH FIRST/) do - firm = client.firm - assert_not_nil firm - assert_equal companies(:first_firm).name, firm.name + assert_equal first_firm, client.firm + assert_equal first_firm.name, client.firm.name end end -- cgit v1.2.3