Class: Shoulda::ActiveModel::Matchers::ValidateAcceptanceOfMatcher
- Inherits:
-
ValidationMatcher
- Object
- ValidationMatcher
- Shoulda::ActiveModel::Matchers::ValidateAcceptanceOfMatcher
- Defined in:
- lib/shoulda/active_model/matchers/validate_acceptance_of_matcher.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from ValidationMatcher
Instance Method Summary collapse
Methods inherited from ValidationMatcher
#initialize, #negative_failure_message
Constructor Details
This class inherits a constructor from Shoulda::ActiveModel::Matchers::ValidationMatcher
Instance Method Details
#description ⇒ Object
33 34 35 |
# File 'lib/shoulda/active_model/matchers/validate_acceptance_of_matcher.rb', line 33 def description "require #{@attribute} to be accepted" end |
#matches?(subject) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/shoulda/active_model/matchers/validate_acceptance_of_matcher.rb', line 27 def matches?(subject) super(subject) @expected_message ||= :accepted disallows_value_of(false, @expected_message) end |
#with_message(message) ⇒ Object
22 23 24 25 |
# File 'lib/shoulda/active_model/matchers/validate_acceptance_of_matcher.rb', line 22 def () @expected_message = if self end |