[rspec-users] Validations aren't being performed when running 'rspec spec'
cdemyanovich at gmail.com
Thu Feb 24 08:48:33 EST 2011
On Wed, Feb 23, 2011 at 10:29 AM, Tom Milewski <tmilewski at gmail.com> wrote:
> validates_presence_of :name, :location, :email...
> it "should ensure that name is present" do
> Factory.build(:public_agent, :name => nil).should
> All of these tests do not return errors and do add the invalid records
> to the database.
> Has anyone else had this happen? Suggestions?
Though I'm still using RSpec 1, I do use FactoryGirl. Factory.build only
instantiates a new record; it does not save it. Thus, the example that you
shared should not create a record. Are you sure that the invalid records
that you're seeing in the database are from this example?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users