Hello, I am new to factory_girl. Sorry if I asked some stupid question.
In GETTING_STARTED.md, there is one thing called build_stubbed.
# Returns an object with all defined attributes stubbed out
stub = build_stubbed(:user)
The comment is not really helpful, can anyone please explain more about this? Perhaps we can update the readme to help out people to understand too.
Check out more here: _Use Factory Girl's build_stubbed for a Faster Test Suite_
build_stubbed is the younger, more hip sibling to build; it instantiates and assigns attributes just like build, but that鈥檚 where the similarities end. It makes objects look look _[sic]_ like they鈥檝e been persisted, creates associations with the build_stubbed strategy (whereas build still uses create), and stubs out a handful of methods that interact with the database and raises if you call them. This leads to much faster tests and reduces your test dependency on a database.
Most helpful comment
Check out more here: _Use Factory Girl's build_stubbed for a Faster Test Suite_