Is there a better way to write this spec? This works but I don’t like the fact that I have to call f.valid? to get f.errors to populate.
it "fails to save the record because the name is blank" do
f = Foo.new
f.valid?
f.errors.include?(:name).should be_true
end
1 Answer