-
Couldn't load subscription status.
- Fork 176
Open
Labels
Description
I have:
class User
include Mongoid::Document
field :name, type: String
validates_length_of :name, in: 1..100, allow_nil: true
endrequire 'rails_helper'
RSpec.describe User, type: :model do
it { is_expected.to validate_length_of(:name).within(1..100).to_allow(nil: true) }
endand caught the error:
Failure/Error: it { is_expected.to validate_length_of(:name).within(1..100).to_allow(nil: true) }
NoMethodError:
undefined method `to_allow' for #<Mongoid::Matchers::Validations::ValidateLengthOfMatcher:0x000055f3d7c01158>
Did you mean? to_yamlDid I make something wrong or it is a bug?
Rails validates_length_of validator.