【发布时间】:2013-01-17 16:00:37
【问题描述】:
这是我想要通过的规范:
context "when validating format of attributes" do
it { should validate_numericality_of(:price).greater_than_or_equal_to(0.01) }
end
我安装了rspec 和shoulda-matchers。但我收到undefined methodgreater_than_or_equal_to'`
现在该方法不在文档中,但它确实存在于此处:
https://github.com/moffff/shoulda-matchers/commit/7da06487d25c27d59d11fb7f2962e7ff345e45c4
那么为什么这不起作用?我应该怎么做才能让它工作?
【问题讨论】:
标签: ruby-on-rails-3 unit-testing activerecord rspec2 shoulda