Factory(:user) hits database?
Posted
by davidegp
on Stack Overflow
See other posts from Stack Overflow
or by davidegp
Published on 2010-06-01T01:08:24Z
Indexed on
2010/06/01
1:13 UTC
Read the original article
Hit count: 200
Playing around with factories, which I read weren't supposed to hit the database, allowing you to avoid having your controller specs interacting with the DB. But when I fire up the Rails console in test and use a factory to create a sample user, I noticed an actual user gets created in the database. Huh? (Using Rails 2.3.8 and Factory Girl 1.2.3.)
© Stack Overflow or respective owner