search for: numericality_of

Displaying 1 result from an estimated 1 matches for "numericality_of".

2007 May 05
10
have_one and have_present
...an customer-friendly, but it still ''speaks'' better than ''have_present'' for me. FYI - Jay Fields has a Validatable framework that includes some test/unit assertions that look like this: Foo.must_validate do presence_of :name format_of(:name).with(/^[A-Z]/) numericality_of(:age).only_integer(true) end Because Spec::Rails behaviours inherit from Test::Unit::TestCase, you can install the validations gem (gem install validatable) and use these as/is with RSpec. Or, if you want it to feel more spec''ish, you could monkey patch an alias: Foo.should_validate do...