Skip to content
chaffeqa edited this page Sep 21, 2011 · 2 revisions

The Getting_Started documentation to add require 'factory_girl/step_definitions' to your features/env.rb file gives you a few glorious step definitions... for free!

Given the following wikis exist:
|title|body|
|First Wiki|Not much|
|Second Wiki|Some|
|Third Wiki|Much More|

Creates the associated factories from the table.

Given a Wiki exists

Simply creates the wiki factory.

Given 6 Wikis exists

English lesson: FactoryGirl should make x6 Wiki factories.

Given a Wiki exists with a title of "First Wiki"

Creates a wiki factory but with the :title column-name being set to "First Wiki"

Given 6 Wikis exist with a title of "First Wiki"

Very nicely creates x6 wiki factories all with the :title column being set to "First Wiki"