instance method
assert_present
Ruby on Rails 3.2.22.5
Since v2.3.18 Last seen in v4.0.13Signature
assert_present(object, message=nil)
Test if an expression is not blank. Passes if object.present? is true.
assert_present {:data => 'x' } # => true
Parameters
-
objectreq -
messageopt = nil
Source
# File activesupport/lib/active_support/testing/assertions.rb, line 91
def assert_present(object, message=nil)
message ||= "#{object.inspect} is blank"
assert object.present?, message
end
Defined in activesupport/lib/active_support/testing/assertions.rb line 91
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Testing::Assertions