diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-01-05 17:59:36 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-01-05 18:04:52 +0100 |
commit | 947e1d5e85fa87128b7c5e21da55b92826cd7801 (patch) | |
tree | 5d86ab00506c39d154226f177cce36245d2fd440 /activerecord/test | |
parent | fada87e916dd50eb6766cac919de41f0be2a12bc (diff) | |
download | rails-947e1d5e85fa87128b7c5e21da55b92826cd7801.tar.gz rails-947e1d5e85fa87128b7c5e21da55b92826cd7801.tar.bz2 rails-947e1d5e85fa87128b7c5e21da55b92826cd7801.zip |
deprecate `assert_blank` and `assert_present`.
They don't add any benefits over `assert object.blank?`
and `assert object.present?`
Diffstat (limited to 'activerecord/test')
4 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index 9b00c21b52..10ec33be75 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -443,8 +443,8 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase def test_has_many_through_uses_conditions_specified_on_the_has_many_association author = Author.first - assert_present author.comments - assert_blank author.nonexistant_comments + assert author.comments.present? + assert author.nonexistant_comments.blank? end def test_has_many_through_uses_correct_attributes diff --git a/activerecord/test/cases/deprecated_dynamic_methods_test.rb b/activerecord/test/cases/deprecated_dynamic_methods_test.rb index dde36e7f72..32eb87d522 100644 --- a/activerecord/test/cases/deprecated_dynamic_methods_test.rb +++ b/activerecord/test/cases/deprecated_dynamic_methods_test.rb @@ -568,9 +568,9 @@ class DynamicScopeTest < ActiveRecord::TestCase end def test_dynamic_scope_should_create_methods_after_hitting_method_missing - assert_blank @test_klass.methods.grep(/scoped_by_type/) + assert @test_klass.methods.grep(/scoped_by_type/).blank? @test_klass.scoped_by_type(nil) - assert_present @test_klass.methods.grep(/scoped_by_type/) + assert @test_klass.methods.grep(/scoped_by_type/).present? end def test_dynamic_scope_with_less_number_of_arguments diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb index d318dab1e1..78fb91d321 100644 --- a/activerecord/test/cases/relation_scoping_test.rb +++ b/activerecord/test/cases/relation_scoping_test.rb @@ -227,7 +227,7 @@ class NestedRelationScopingTest < ActiveRecord::TestCase def test_nested_exclusive_scope_for_create comment = Comment.create_with(:body => "Hey guys, nested scopes are broken. Please fix!").scoping do Comment.unscoped.create_with(:post_id => 1).scoping do - assert_blank Comment.new.body + assert Comment.new.body.blank? Comment.create :body => "Hey guys" end end diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 0cd838c0b0..3a499a2025 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -509,7 +509,7 @@ class RelationTest < ActiveRecord::TestCase def test_find_in_empty_array authors = Author.all.where(:id => []) - assert_blank authors.to_a + assert authors.to_a.blank? end def test_where_with_ar_object @@ -723,7 +723,7 @@ class RelationTest < ActiveRecord::TestCase def test_relation_merging_with_locks devs = Developer.lock.where("salary >= 80000").order("id DESC").merge(Developer.limit(2)) - assert_present devs.locked + assert devs.locked.present? end def test_relation_merging_with_preload |