evansagge/mongoid-rspec — Issue #50: Inclusion validator does not support ranges
Author: pericles
Created: 2011-11-26 17:58:00+00:00
State: open

I have the following validator `validates :maximum_amount, numericality: true, inclusion: { in: 1..16 }` in my model and in the spec i have `it { should validate_inclusion_of(:maximum_amount).to_allow(1..16) }` which fails with `can't convert Range into Array` because you have `not_allowed_values = @allowed_values - @validator.options[:in]`.