lib/rspec/sleeping_king_studios/matchers/active_model/have_errors_matcher.rb
# Checks if the object can be validated, whether the object is valid, and
# checks the errors on the object against the expected errors and messages
# from #on and #with_message, if any.
#
# @param [Object] actual The object to test against the matcher.
#
# @return [Boolean] True if the object responds to :valid?, is not valid,
#   and object.errors matches the specified errors and messages (if any);
#   otherwise false.
#
# @see RSpec::SleepingKingStudios::Matchers::BaseMatcher#matches?
Checks if the object can be validated, whether the object is valid, and
checks the errors on the object against the expected errors and messages
from #on and #with_message, if any.
Checks if the object can be validated whether the object is valid and checks the errors on the object against the expected errors and messages from #on and #with_message if any .
def matches? actual
      super
      return false unless @validates = actual.respond_to?(:valid?)
      !@actual.valid? && attributes_have_errors?
    end
def matches? actual super return false unless @validates = actual . respond_to? ( :valid? ) ! @actual . valid? && attributes_have_errors? end
Checks if the object can be validated, whether the object is valid, and
checks the errors on the object against the expected errors and messages
from #on and #with_message, if any.
Checks if the object can be validated whether the object is valid and checks the errors on the object against the expected errors and messages from #on and #with_message if any .
True if the object responds to :valid?, is not valid, and object.errors matches the specified errors and messages (if any); otherwise false.
True if the object responds to : valid? is not valid and object . errors matches the specified errors and messages ( if any ) ; otherwise false .
Boolean
actual
<not_specific>
<not_specific>
actual The object to test against the matcher.
actual The object to test against the matcher .
see
None