class Shoulda::Matchers::ActiveModel::ValidateAcceptanceOfMatcher
@private
Public Instance Methods
description()
click to toggle source
# File lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb, line 71 def description "require #{@attribute} to be accepted" end
matches?(subject)
click to toggle source
Calls superclass method
# File lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb, line 65 def matches?(subject) super(subject) @expected_message ||= :accepted disallows_value_of(false, @expected_message) end
with_message(message)
click to toggle source
# File lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb, line 58 def with_message(message) if message @expected_message = message end self end