Skip to content

Instantly share code, notes, and snippets.

@jgonera
Created August 29, 2011 14:24
Show Gist options
  • Select an option

  • Save jgonera/1178495 to your computer and use it in GitHub Desktop.

Select an option

Save jgonera/1178495 to your computer and use it in GitHub Desktop.
# Fabrication
Fabricator(:user) do
email { sequence(:email) { |n| "tester#{n}@test.com" } }
password 'tester'
end
Fabricator(:store, from: :dropbox_store) do
path '/myproject'
end
Fabricator(:project) do
name { sequence(:name) { |n| "A project #{n}" } }
store
end
# FactoryGirl
FactoryGirl.define do
factory :user do
sequence(:email) { |n| "tester#{n}@test.com" }
password 'tester'
end
factory :store, class: DropboxStore do
path '/myproject'
end
factory :project do
sequence(:name) { |n| "A project #{n}" }
store
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment