1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use assert_nil if value is nil in assert_field_default_value

It is deprecate to specify nil for expect argument of `assert_equal`.
Ref: 922bc9151a
This commit is contained in:
yuuji.yaginuma 2017-08-03 21:51:15 +09:00
parent 5fd50c387b
commit 1a2fc2eb7b

View file

@ -113,7 +113,11 @@ module Rails
#
# assert_field_default_value :string, "MyString"
def assert_field_default_value(attribute_type, value)
assert_equal(value, create_generated_attribute(attribute_type).default)
if value.nil?
assert_nil(create_generated_attribute(attribute_type).default)
else
assert_equal(value, create_generated_attribute(attribute_type).default)
end
end
end
end