File tree Expand file tree Collapse file tree 7 files changed +11
-8
lines changed
actionpack/test/controller
activerecord/test/cases/associations
railties/test/application Expand file tree Collapse file tree 7 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -384,6 +384,9 @@ Performance/RedundantStringChars:
384
384
Performance/StringInclude :
385
385
Enabled : true
386
386
387
+ Minitest/AssertNil :
388
+ Enabled : true
389
+
387
390
Minitest/AssertPredicate :
388
391
Enabled : true
389
392
Original file line number Diff line number Diff line change @@ -495,7 +495,7 @@ def test_post_then_get_with_parameters_do_not_leak_across_requests
495
495
assert_equal "foo=bar" , request . env [ "QUERY_STRING" ]
496
496
assert_equal "foo=bar" , request . query_string
497
497
assert_equal "bar" , request . parameters [ "foo" ]
498
- assert_predicate request . parameters [ "leaks" ] , :nil?
498
+ assert_nil request . parameters [ "leaks" ]
499
499
end
500
500
end
501
501
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class ActionText::ModelTest < ActiveSupport::TestCase
18
18
test "without content" do
19
19
assert_difference ( "ActionText::RichText.count" => 0 ) do
20
20
message = Message . create! ( subject : "Greetings" )
21
- assert_predicate message . content , :nil?
21
+ assert_nil message . content
22
22
assert_predicate message . content , :blank?
23
23
assert_predicate message . content , :empty?
24
24
assert_not message . content?
@@ -146,7 +146,7 @@ class ActionText::ModelTest < ActiveSupport::TestCase
146
146
test "with blank content and store_if_blank: false" do
147
147
assert_difference ( "ActionText::RichText.count" => 0 ) do
148
148
message = MessageWithoutBlanks . create! ( subject : "Greetings" , content : "" )
149
- assert_predicate message . content , :nil?
149
+ assert_nil message . content
150
150
assert_predicate message . content , :blank?
151
151
assert_predicate message . content , :empty?
152
152
assert_not message . content?
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ module Type
7
7
class BooleanTest < ActiveModel ::TestCase
8
8
def test_type_cast_boolean
9
9
type = Type ::Boolean . new
10
- assert_predicate type . cast ( "" ) , :nil?
11
- assert_predicate type . cast ( nil ) , :nil?
10
+ assert_nil type . cast ( "" )
11
+ assert_nil type . cast ( nil )
12
12
13
13
assert type . cast ( true )
14
14
assert type . cast ( 1 )
Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ def test_validation_with_if_and_on
252
252
253
253
# If block should not fire
254
254
assert_predicate t , :valid?
255
- assert_predicate t . author_name , :nil?
255
+ assert_nil t . author_name
256
256
257
257
# If block should fire
258
258
assert t . invalid? ( :update )
Original file line number Diff line number Diff line change @@ -1243,7 +1243,7 @@ def test_deleting_from_has_many_through_a_belongs_to_should_not_try_to_update_co
1243
1243
1244
1244
assert_includes post . author_addresses , address
1245
1245
post . author_addresses . delete ( address )
1246
- assert_predicate post [ :author_count ] , :nil?
1246
+ assert_nil post [ :author_count ]
1247
1247
end
1248
1248
1249
1249
def test_primary_key_option_on_source
Original file line number Diff line number Diff line change @@ -4028,7 +4028,7 @@ class Post < ActiveRecord::Base
4028
4028
4029
4029
app "development"
4030
4030
4031
- assert_equal nil , ActiveStorage . variant_processor
4031
+ assert_nil ActiveStorage . variant_processor
4032
4032
end
4033
4033
4034
4034
test "ActiveStorage.variant_processor uses vips by default" do
You can’t perform that action at this time.
0 commit comments