aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2016-12-25 02:29:52 +0900
committerAkira Matsuda <ronnie@dio.jp>2016-12-25 02:29:52 +0900
commite8ba0c0f21e2660b90f872fa4595156ca6190c77 (patch)
treed7bbc63157a1658802183fde1427abf8b3a90aa2 /activemodel/test
parent9d9a4bd7cf75d378109d043fd1f466dc27416223 (diff)
downloadrails-e8ba0c0f21e2660b90f872fa4595156ca6190c77.tar.gz
rails-e8ba0c0f21e2660b90f872fa4595156ca6190c77.tar.bz2
rails-e8ba0c0f21e2660b90f872fa4595156ca6190c77.zip
"Use assert_nil if expecting nil. This will fail in minitest 6."
Diffstat (limited to 'activemodel/test')
-rw-r--r--activemodel/test/cases/secure_password_test.rb2
-rw-r--r--activemodel/test/cases/type/binary_test.rb2
-rw-r--r--activemodel/test/cases/type/date_test.rb8
-rw-r--r--activemodel/test/cases/type/date_time_test.rb8
-rw-r--r--activemodel/test/cases/type/time_test.rb6
5 files changed, 13 insertions, 13 deletions
diff --git a/activemodel/test/cases/secure_password_test.rb b/activemodel/test/cases/secure_password_test.rb
index 9423df2c09..77ce86f392 100644
--- a/activemodel/test/cases/secure_password_test.rb
+++ b/activemodel/test/cases/secure_password_test.rb
@@ -179,7 +179,7 @@ class SecurePasswordTest < ActiveModel::TestCase
test "setting a nil password should clear an existing password" do
@existing_user.password = nil
- assert_equal nil, @existing_user.password_digest
+ assert_nil @existing_user.password_digest
end
test "authenticate" do
diff --git a/activemodel/test/cases/type/binary_test.rb b/activemodel/test/cases/type/binary_test.rb
index e6a32dbeec..e9c2ccfca4 100644
--- a/activemodel/test/cases/type/binary_test.rb
+++ b/activemodel/test/cases/type/binary_test.rb
@@ -6,7 +6,7 @@ module ActiveModel
class BinaryTest < ActiveModel::TestCase
def test_type_cast_binary
type = Type::Binary.new
- assert_equal nil, type.cast(nil)
+ assert_nil type.cast(nil)
assert_equal "1", type.cast("1")
assert_equal 1, type.cast(1)
end
diff --git a/activemodel/test/cases/type/date_test.rb b/activemodel/test/cases/type/date_test.rb
index 44e20a327b..0cc90e99d3 100644
--- a/activemodel/test/cases/type/date_test.rb
+++ b/activemodel/test/cases/type/date_test.rb
@@ -6,10 +6,10 @@ module ActiveModel
class DateTest < ActiveModel::TestCase
def test_type_cast_date
type = Type::Date.new
- assert_equal nil, type.cast(nil)
- assert_equal nil, type.cast("")
- assert_equal nil, type.cast(" ")
- assert_equal nil, type.cast("ABC")
+ assert_nil type.cast(nil)
+ assert_nil type.cast("")
+ assert_nil type.cast(" ")
+ assert_nil type.cast("ABC")
date_string = ::Time.now.utc.strftime("%F")
assert_equal date_string, type.cast(date_string).strftime("%F")
diff --git a/activemodel/test/cases/type/date_time_test.rb b/activemodel/test/cases/type/date_time_test.rb
index fb82260d2b..75a7fc686e 100644
--- a/activemodel/test/cases/type/date_time_test.rb
+++ b/activemodel/test/cases/type/date_time_test.rb
@@ -6,10 +6,10 @@ module ActiveModel
class DateTimeTest < ActiveModel::TestCase
def test_type_cast_datetime_and_timestamp
type = Type::DateTime.new
- assert_equal nil, type.cast(nil)
- assert_equal nil, type.cast("")
- assert_equal nil, type.cast(" ")
- assert_equal nil, type.cast("ABC")
+ assert_nil type.cast(nil)
+ assert_nil type.cast("")
+ assert_nil type.cast(" ")
+ assert_nil type.cast("ABC")
datetime_string = ::Time.now.utc.strftime("%FT%T")
assert_equal datetime_string, type.cast(datetime_string).strftime("%FT%T")
diff --git a/activemodel/test/cases/type/time_test.rb b/activemodel/test/cases/type/time_test.rb
index a6a79833e6..0cc4d33caa 100644
--- a/activemodel/test/cases/type/time_test.rb
+++ b/activemodel/test/cases/type/time_test.rb
@@ -6,9 +6,9 @@ module ActiveModel
class TimeTest < ActiveModel::TestCase
def test_type_cast_time
type = Type::Time.new
- assert_equal nil, type.cast(nil)
- assert_equal nil, type.cast("")
- assert_equal nil, type.cast("ABC")
+ assert_nil type.cast(nil)
+ assert_nil type.cast("")
+ assert_nil type.cast("ABC")
time_string = ::Time.now.utc.strftime("%T")
assert_equal time_string, type.cast(time_string).strftime("%T")