2011-09-05 20:00:08 +02:00
|
|
|
begin
|
|
|
|
|
Factory.define :user do |u|
|
|
|
|
|
u.sequence(:login) { |n| "testuser#{n}" }
|
|
|
|
|
u.password "secret"
|
|
|
|
|
u.password_confirmation { |user| user.password }
|
|
|
|
|
u.is_admin false
|
|
|
|
|
end
|
2010-07-29 18:06:30 +02:00
|
|
|
|
2011-09-05 20:00:08 +02:00
|
|
|
Factory.define :context do |c|
|
|
|
|
|
c.sequence(:name) { |n| "testcontext#{n}" }
|
|
|
|
|
c.hide false
|
|
|
|
|
c.created_at Time.now.utc
|
|
|
|
|
end
|
2011-02-28 22:58:39 -08:00
|
|
|
|
2011-09-05 20:00:08 +02:00
|
|
|
Factory.define :project do |p|
|
|
|
|
|
p.sequence(:name) { |n| "testproject#{n}" }
|
|
|
|
|
end
|
2011-02-28 22:58:39 -08:00
|
|
|
|
2011-09-05 20:00:08 +02:00
|
|
|
Factory.define :todo do |t|
|
|
|
|
|
t.sequence(:description) { |n| "testtodo#{n}" }
|
|
|
|
|
t.association :context
|
|
|
|
|
end
|
2011-11-18 11:43:06 +01:00
|
|
|
|
2011-09-05 20:00:08 +02:00
|
|
|
rescue FactoryGirl::DuplicateDefinitionError
|
|
|
|
|
# No problem, apparently this file was included already.
|
2011-02-28 22:58:39 -08:00
|
|
|
end
|