diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-05-18 21:47:24 -0400 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-19 10:18:36 +0200 |
commit | b4629528866446aa59f663a1162edbdacee85600 (patch) | |
tree | d68a0f440d552285adf99b462b8bde39d346aaa6 /activerecord/test/cases/associations/inverse_associations_test.rb | |
parent | b753b4a076d7067efccbd1ad384829f77e62a064 (diff) | |
download | rails-b4629528866446aa59f663a1162edbdacee85600.tar.gz rails-b4629528866446aa59f663a1162edbdacee85600.tar.bz2 rails-b4629528866446aa59f663a1162edbdacee85600.zip |
Use better assertion methods for testing
[#4645 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases/associations/inverse_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/inverse_associations_test.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/activerecord/test/cases/associations/inverse_associations_test.rb b/activerecord/test/cases/associations/inverse_associations_test.rb index 1d7604f52b..34d24a2948 100644 --- a/activerecord/test/cases/associations/inverse_associations_test.rb +++ b/activerecord/test/cases/associations/inverse_associations_test.rb @@ -23,39 +23,39 @@ class InverseAssociationTests < ActiveRecord::TestCase def test_should_be_able_to_ask_a_reflection_if_it_has_an_inverse has_one_with_inverse_ref = Man.reflect_on_association(:face) - assert has_one_with_inverse_ref.respond_to?(:has_inverse?) + assert_respond_to has_one_with_inverse_ref, :has_inverse? assert has_one_with_inverse_ref.has_inverse? has_many_with_inverse_ref = Man.reflect_on_association(:interests) - assert has_many_with_inverse_ref.respond_to?(:has_inverse?) + assert_respond_to has_many_with_inverse_ref, :has_inverse? assert has_many_with_inverse_ref.has_inverse? belongs_to_with_inverse_ref = Face.reflect_on_association(:man) - assert belongs_to_with_inverse_ref.respond_to?(:has_inverse?) + assert_respond_to belongs_to_with_inverse_ref, :has_inverse? assert belongs_to_with_inverse_ref.has_inverse? has_one_without_inverse_ref = Club.reflect_on_association(:sponsor) - assert has_one_without_inverse_ref.respond_to?(:has_inverse?) + assert_respond_to has_one_without_inverse_ref, :has_inverse? assert !has_one_without_inverse_ref.has_inverse? has_many_without_inverse_ref = Club.reflect_on_association(:memberships) - assert has_many_without_inverse_ref.respond_to?(:has_inverse?) + assert_respond_to has_many_without_inverse_ref, :has_inverse? assert !has_many_without_inverse_ref.has_inverse? belongs_to_without_inverse_ref = Sponsor.reflect_on_association(:sponsor_club) - assert belongs_to_without_inverse_ref.respond_to?(:has_inverse?) + assert_respond_to belongs_to_without_inverse_ref, :has_inverse? assert !belongs_to_without_inverse_ref.has_inverse? end def test_should_be_able_to_ask_a_reflection_what_it_is_the_inverse_of has_one_ref = Man.reflect_on_association(:face) - assert has_one_ref.respond_to?(:inverse_of) + assert_respond_to has_one_ref, :inverse_of has_many_ref = Man.reflect_on_association(:interests) - assert has_many_ref.respond_to?(:inverse_of) + assert_respond_to has_many_ref, :inverse_of belongs_to_ref = Face.reflect_on_association(:man) - assert belongs_to_ref.respond_to?(:inverse_of) + assert_respond_to belongs_to_ref, :inverse_of end def test_inverse_of_method_should_supply_the_actual_reflection_instance_it_is_the_inverse_of |