scottohara / loot

An implementation of some of the core MS Money features in Ruby on Rails
MIT License
4 stars 3 forks source link

Should we test validations? #71

Open scottohara opened 9 years ago

scottohara commented 9 years ago

In Rspec model specs; we have specs to test any custom validation methods; however we're not currently testing standard rails validations (eg. validates :name, :presence => true).

FactoryGirl.lint partially does this by linting our factories and flagging any that fail validation; but do we also need to explicitly create a spec like:

let(:payee) { build :payee, name: nil }
it "should be invalid without a name" do
  expect(payee).to_not be_valid
end

Or is that considered testing Rails itself?