Skip to content

Instantly share code, notes, and snippets.

@yakovenkodenis
Created July 31, 2015 19:29
Show Gist options
  • Save yakovenkodenis/043ba3a18b782b4c8c91 to your computer and use it in GitHub Desktop.
Save yakovenkodenis/043ba3a18b782b4c8c91 to your computer and use it in GitHub Desktop.
FactoryGirl example
# Пример файла в папке spec/factories
FactoryGirl.define do
factory :project do
sequence(:name) { |n| "My Project #{n}" }
client 'My Client'
archived false
end
end
# Использование в спеках
create(:user) <--- делает изменение в бд
build(:user) <--- не делает изменение в бд
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment