method

assert_present

rails latest stable - Class: ActiveSupport::Testing::Assertions

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.0.2) is shown here.

assert_present(object, message=nil)
public

Test if an expression is not blank. Passes if object.present? is true.

assert_present({ data: 'x' }) # => true
assert_present({})            # => {} is blank

An error message can be specified.

assert_present({ data: 'x' }, 'this should not be blank')