factory test

Ruby code posted
created at 26 Jul 14:58

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
Factory.define :user do |f|
  f.sequence(:username) { |n| "user#{n}" }
  f.password "test"
  f.password_confirmation { |u| u.password }
  f.sequence(:email) { |n| "user#{n}@example.com" }
end

Factory.define :category do |f|
  f.sequence(:name) { |n| "category#{n}" }
  #f.association :user
end
306 Bytes in 2 ms with coderay