Skip to content

Instantly share code, notes, and snippets.

@chintanparikh
Created June 5, 2012 06:52
Show Gist options
  • Save chintanparikh/2873166 to your computer and use it in GitHub Desktop.
Save chintanparikh/2873166 to your computer and use it in GitHub Desktop.
--------------------- post_steps.rb (Using this with Cucumber) --------------------
Given /^there is a post called "(.*?)"$/ do |title|
FactoryGirl.create(:post, :title => title)
end
--------------------- factories/post_factory.rb -----------------------------
FactoryGirl.define do
factory :post do
title 'Hello, World'
content 'Hello world! This is a blog post'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment