Skip to content

Instantly share code, notes, and snippets.

@ntreadway
Created April 13, 2009 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntreadway/94672 to your computer and use it in GitHub Desktop.
Save ntreadway/94672 to your computer and use it in GitHub Desktop.
#factories setup w/ cucumber.
#(env.rb)
require 'factory_girl'
Before do
require File.join(RAILS_ROOT, 'test', 'factories')
end
#Then in your (setups.rb) you can create your object using one line.
Given /I am logged in as a user/ do
@user = Factory(:user)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment