using factory girl with cucumber on rails 2.3.2

I’m in the middle of using factory_girl with cucumber on rails 2.3.2, I followed ryan bates’s screencast but it doesn’t seems to work, cucumber keep saying that it don’t know about Factory.

But factory_girl work with my specs, so after I dig into the app’s structure I saw that there’s a cucumber.rb file in the environments directory, I open it up and I has contents that almost like test.rb, only one thing is missing, the config about factory_girl. A quick copy of these line

config.gem "thoughtbot-factory_girl",
           :lib    => "factory_girl",
           :source => "http://gems.github.com"


and paste it in the cucumber.rb, and the features are all green :D

Advertisements

One thought on “using factory girl with cucumber on rails 2.3.2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s