Class: Shoulda::Matchers::ActiveModel::RequireAValidCurpMatcher

Inherits:
ValidationMatcher
  • Object
show all
Defined in:
lib/validates_curp/require_a_valid_curp_matcher.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



13
14
15
# File 'lib/validates_curp/require_a_valid_curp_matcher.rb', line 13

def description
  'requires a valid CURP'
end

#failure_messageObject



17
18
19
# File 'lib/validates_curp/require_a_valid_curp_matcher.rb', line 17

def failure_message
  'does not require a valid CURP'
end

#matches?(subject) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
# File 'lib/validates_curp/require_a_valid_curp_matcher.rb', line 21

def matches?(subject)
  super(subject)
  disallows_value_of('123456') && allows_value_of('HEGG560427MVCRRL04')
end