From fdfebb7782a399839ac9a9e63d5153565d6f88f4 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 16 May 2010 10:37:57 -0300 Subject: Make use of assert_equal to test equallity between object assert expects and object and a message of error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#4611 state:committed] Signed-off-by: José Valim --- activerecord/test/cases/associations/join_model_test.rb | 2 +- activerecord/test/cases/autosave_association_test.rb | 4 ++-- activerecord/test/cases/finder_test.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'activerecord') diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index 8bdf8bcd55..dca72be4fd 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -289,7 +289,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase end def test_has_many_array_methods_called_by_method_missing - assert true, authors(:david).categories.any? { |category| category.name == 'General' } + assert authors(:david).categories.any? { |category| category.name == 'General' } assert_nothing_raised { authors(:david).categories.sort } end diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb index 2995cc6f72..5cc5dff633 100644 --- a/activerecord/test/cases/autosave_association_test.rb +++ b/activerecord/test/cases/autosave_association_test.rb @@ -765,7 +765,7 @@ class TestAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCase @ship.destroy @pirate.reload.catchphrase = "Arr" @pirate.save - assert 'Arr', @pirate.reload.catchphrase + assert_equal 'Arr', @pirate.reload.catchphrase end def test_should_automatically_save_the_associated_model @@ -885,7 +885,7 @@ class TestAutosaveAssociationOnABelongsToAssociation < ActiveRecord::TestCase @pirate.destroy @ship.reload.name = "The Vile Insanity" @ship.save - assert 'The Vile Insanity', @ship.reload.name + assert_equal 'The Vile Insanity', @ship.reload.name end def test_should_automatically_save_the_associated_model diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index e78db8969d..c73ad50a71 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -722,10 +722,10 @@ class FinderTest < ActiveRecord::TestCase def test_find_all_by_one_attribute_with_options topics = Topic.find_all_by_content("Have a nice day", :order => "id DESC") - assert topics(:first), topics.last + assert_equal topics(:first), topics.last topics = Topic.find_all_by_content("Have a nice day", :order => "id") - assert topics(:first), topics.first + assert_equal topics(:first), topics.first end def test_find_all_by_array_attribute -- cgit v1.2.3