diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-08-29 21:51:32 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-08-29 21:51:32 -0700 |
commit | c67c5e6ba0fd098d25094810ac7243b73a140be1 (patch) | |
tree | 9940ebaf6ee3d2be7f8301cf9d52b78feec83e1b /activesupport/test | |
parent | f0737d80d75e03665d4387549495a3ae67e3faf5 (diff) | |
download | rails-c67c5e6ba0fd098d25094810ac7243b73a140be1.tar.gz rails-c67c5e6ba0fd098d25094810ac7243b73a140be1.tar.bz2 rails-c67c5e6ba0fd098d25094810ac7243b73a140be1.zip |
Bring back the test cases for `presence`
This was removed by mistake in 5e51bdd
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/object/blank_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/object/blank_test.rb b/activesupport/test/core_ext/object/blank_test.rb index d6c69bd582..246bc7fa61 100644 --- a/activesupport/test/core_ext/object/blank_test.rb +++ b/activesupport/test/core_ext/object/blank_test.rb @@ -28,4 +28,9 @@ class BlankTest < ActiveSupport::TestCase BLANK.each { |v| assert_equal false, v.present?, "#{v.inspect} should not be present" } NOT.each { |v| assert_equal true, v.present?, "#{v.inspect} should be present" } end + + def test_presence + BLANK.each { |v| assert_equal nil, v.presence, "#{v.inspect}.presence should return nil" } + NOT.each { |v| assert_equal v, v.presence, "#{v.inspect}.presence should return self" } + end end |