0
我試圖按照與RSpec的TDD教程包含以下行:更改RSpec的錯誤檢查
it 'must have a first_name' do
p = Person.new
p.should_not be_valid
p.errors.on(:first_name).should_not be_nil
end
但是我在我的測試中收到以下消息:
未定義的方法'on'for #ActiveModel :: Errors:0x007fde0c3eceb0>
什麼是寫上面代碼的正確方法。