aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/belongs_to_associations_test.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2011-02-18 15:29:33 -0300
committerEmilio Tagua <miloops@gmail.com>2011-02-18 15:29:33 -0300
commit0b702ba3de42ed2ae8855843127f898102802b77 (patch)
treefc7d9b2fd78c3558dd978f3b67e5e58792551668 /activerecord/test/cases/associations/belongs_to_associations_test.rb
parent90a850aea4c2c04df22be0aaad1144468fcc8078 (diff)
parent1644663ba7f678d178deab2bf1629dc05626f85b (diff)
downloadrails-0b702ba3de42ed2ae8855843127f898102802b77.tar.gz
rails-0b702ba3de42ed2ae8855843127f898102802b77.tar.bz2
rails-0b702ba3de42ed2ae8855843127f898102802b77.zip
Merge remote branch 'rails/master' into identity_map
Conflicts: activerecord/lib/active_record/associations/association.rb activerecord/lib/active_record/fixtures.rb
Diffstat (limited to 'activerecord/test/cases/associations/belongs_to_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb
index 01073bca3d..9006914508 100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
@@ -50,11 +50,6 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
assert_nothing_raised { account.firm = account.firm }
end
- def test_triple_equality
- assert Client.find(3).firm === Firm
- assert Firm === Client.find(3).firm
- end
-
def test_type_mismatch
assert_raise(ActiveRecord::AssociationTypeMismatch) { Account.find(1).firm = 1 }
assert_raise(ActiveRecord::AssociationTypeMismatch) { Account.find(1).firm = Project.find(1) }
@@ -569,13 +564,15 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
def test_reloading_association_with_key_change
client = companies(:second_client)
- firm = client.firm # note this is a proxy object
+ firm = client.association(:firm)
client.firm = companies(:another_firm)
- assert_equal companies(:another_firm), firm.reload
+ firm.reload
+ assert_equal companies(:another_firm), firm.target
client.client_of = companies(:first_firm).id
- assert_equal companies(:first_firm), firm.reload
+ firm.reload
+ assert_equal companies(:first_firm), firm.target
end
def test_polymorphic_counter_cache