Module: Ubazu::Rspec::Matchers::ActiveRecord
- Included in:
- RSpec::Matchers
- Defined in:
- lib/ubazu/rspec/matchers/active_record.rb,
lib/ubazu/rspec/matchers/active_record/helpers.rb,
lib/ubazu/rspec/matchers/active_record/validation_matcher.rb,
lib/ubazu/rspec/matchers/active_record/validate_inclusion_of_matcher.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Helpers Classes: ValidateInclusionOfMatcher, ValidationMatcher
Instance Method Summary collapse
-
#validate_inclusion_of(attr) ⇒ Object
Ensures that the model field value is included in specified array.
Instance Method Details
#validate_inclusion_of(attr) ⇒ Object
Ensures that the model field value is included in specified array.
Options:
-
with_message
- value the test expects to find inerrors.on(:attribute)
.Regexp
orString
. Defaults to the translation for:blank
.
Examples:
it { should validate_inclusion_of(:name).in(:array) }
it { should validate_inclusion_of(:name).in(:array)
(/is not optional/) }
18 19 20 |
# File 'lib/ubazu/rspec/matchers/active_record/validate_inclusion_of_matcher.rb', line 18 def validate_inclusion_of(attr) ValidateInclusionOfMatcher.new(attr) end |