evansagge/mongoid-rspec — pull request #68 by nessche (2012-05-24 11:55:44+00:00)
Title: Matcher for custom validator

I have added a matcher for custom validator. In other words it is possible to see if a field is being validated by a custom validator, check the class of the custom validator and the message it generates.

Currently the syntax (explained in the updated README.rd) is

it { should custom_validate(:my_field).with_validator(TheCustomValidator) }

but feel free to rename the matcher and methods if you find better/more appropriate names.

I have also added a dummy custom validator, a model (Person) and some tests to verify the new functionality.