Last active
March 13, 2016 08:12
-
-
Save chenbojian/7f15b97a90f63efe67ac to your computer and use it in GitHub Desktop.
learn ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'factory_girl' | |
require 'securerandom' | |
FactoryGirl.define do | |
factory :user do | |
haha SecureRandom.hex(10) | |
hehe 88 | |
end | |
end | |
class User | |
attr_accessor 'haha', 'hehe' | |
end | |
p FactoryGirl.build(:user) | |
p FactoryGirl.build(:user, hehe: 17) | |
p FactoryGirl.build(:user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment