Purpose of Factory girl?

What’s the purpose of using Factory girl?

Replace fixtures for creating data for your tests. As app gets bigger,
fixtures become brittle. With Factory Girl (or Machinist) you can create
just the test data you need for a given test.

Best Wishes,
Peter

Thanks - what exactly are fixtures? And do Factory Girl and Machinist
serve the same purpose?

You can get an idea about fixtures here:

http://guides.rubyonrails.org/testing.html#the-low-down-on-fixturesAnd
the
guides are a great resource to understand the basics about Rails.

Factory Girl and Machinist serve the same purpose but in my opinion it’s
easier to generate data for your tests using them.

Check their pages to see more: GitHub - notahat/machinist: Fixtures aren't fun. Machinist is. and
GitHub - thoughtbot/factory_bot_rails: Factory Bot ♥ Rails


Carlos Galdino
codecleaning.com

Come on man - that’s what google is for. Check out some of the 101 stuff
so we can help with anything you can’t get in 2 mind on google.

Best Wishes,
Peter

First read about testing. Once you know what testing is all will be
clear.

Thanks Carlos!

On 8 March 2011 15:47, Gaba L. [email protected] wrote:

Thanks - what exactly are fixtures?

Have a look through the Rails Guides.

Work through the free tutorial at railstutorial.org and many of the
basic things that you have been asking about will become clear. Other
things may become less clear of course :slight_smile:

Colin