aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-08-29 21:51:32 -0700
committerGodfrey Chan <godfreykfc@gmail.com>2014-08-29 21:51:32 -0700
commitc67c5e6ba0fd098d25094810ac7243b73a140be1 (patch)
tree9940ebaf6ee3d2be7f8301cf9d52b78feec83e1b /activesupport
parentf0737d80d75e03665d4387549495a3ae67e3faf5 (diff)
downloadrails-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')
-rw-r--r--activesupport/test/core_ext/object/blank_test.rb5
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