Forum: RSpec should validate_numericality_of with greater_than_or_equal_to

Posted by Slava Mikerin (slavix)
on 2011-09-04 07:31
(Received via mailing list)
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/class...
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.