Module: Mongoid::Matchers::Validations

Included in:
Mongoid::Matchers
Defined in:
lib/matchers/validations.rb,
lib/matchers/validations/format_of.rb,
lib/matchers/validations/length_of.rb,
lib/matchers/validations/associated.rb,
lib/matchers/validations/presence_of.rb,
lib/matchers/validations/inclusion_of.rb,
lib/matchers/validations/uniqueness_of.rb,
lib/matchers/validations/confirmation_of.rb,
lib/matchers/validations/numericality_of.rb

Defined Under Namespace

Classes: HaveValidationMatcher, ValidateAssociatedMatcher, ValidateFormatOfMatcher, ValidateInclusionOfMatcher, ValidateLengthOfMatcher, ValidateNumericalityOfMatcher, ValidateUniquenessOfMatcher

Instance Method Summary collapse

Instance Method Details

#validate_associated(association_name) ⇒ Object



14
15
16
# File 'lib/matchers/validations/associated.rb', line 14

def validate_associated(association_name)
  ValidateAssociatedMatcher.new(association_name)
end

#validate_confirmation_of(field) ⇒ Object



4
5
6
# File 'lib/matchers/validations/confirmation_of.rb', line 4

def validate_confirmation_of(field)
  HaveValidationMatcher.new(field, :confirmation)
end

#validate_format_of(field) ⇒ Object



66
67
68
# File 'lib/matchers/validations/format_of.rb', line 66

def validate_format_of(field)
  ValidateFormatOfMatcher.new(field)
end

#validate_inclusion_of(field) ⇒ Object



37
38
39
# File 'lib/matchers/validations/inclusion_of.rb', line 37

def validate_inclusion_of(field)
  ValidateInclusionOfMatcher.new(field)
end

#validate_length_of(field) ⇒ Object



95
96
97
# File 'lib/matchers/validations/length_of.rb', line 95

def validate_length_of(field)
  ValidateLengthOfMatcher.new(field)
end

#validate_numericality_of(field) ⇒ Object



69
70
71
# File 'lib/matchers/validations/numericality_of.rb', line 69

def validate_numericality_of(field)
  ValidateNumericalityOfMatcher.new(field)
end

#validate_presence_of(field) ⇒ Object



4
5
6
# File 'lib/matchers/validations/presence_of.rb', line 4

def validate_presence_of(field)
  HaveValidationMatcher.new(field, :presence)
end

#validate_uniqueness_of(field) ⇒ Object



94
95
96
# File 'lib/matchers/validations/uniqueness_of.rb', line 94

def validate_uniqueness_of(field)
  ValidateUniquenessOfMatcher.new(field)
end