README.md in mongoid-rspec-1.4.5 vs README.md in mongoid-rspec-1.4.6
- old
+ new
@@ -76,9 +76,14 @@
describe MovieArticle do
it { should validate_numericality_of(:rating).to_allow(:greater_than => 0).less_than_or_equal_to(5) }
it { should validate_numericality_of(:classification).to_allow(:even => true, :only_integer => true, :nil => false) }
end
+ describe Person do
+ # in order to be able to use the custom_validate matcher, the custom validator class (in this case SsnValidator)
+ # should redefine the kind method to return :custom, i.e. "def self.kind() :custom end"
+ it { should custom_validate(:ssn).with_validator(SsnValidator) }
+ end
Others
-
describe User do
it { should have_fields(:email, :login) }
it { should have_field(:active).of_type(Boolean).with_default_value_of(false) }