[rspec-users] should validate_numericality_of with greater_than_or_equal_to

slavix mikerin.slava at gmail.com
Sun Sep 4 01:01:35 EDT 2011


Hello,
I have this in my spec
    it { should
validate_numericality_of(:amount).greater_than_or_equal_to(0) }

but I get error:

Failure/Error: it { should
validate_numericality_of(:amount).greater_than_or_equal_to(0) }
     NoMethodError:
       undefined method `greater_than_or_equal_to' for
#<RSpec::Matchers::Matcher:0xef23150>

this page
http://remarkable.rubyforge.org/activerecord/classes/Remarkable/ActiveRecord/Matchers.html
has method
  it { should validate_numericality_of(:age).only_integer }

and :less_than_or_equal_to is a valid option..

I am confused. How do I spec this? thanks.


More information about the rspec-users mailing list