Adding a couple factories
This commit is contained in:
parent
46b889b54b
commit
659c805ea9
@ -5,6 +5,14 @@ Factory.define :site do |s|
|
||||
s.created_at Time.now
|
||||
end
|
||||
|
||||
Factory.define "test site", :parent => :site do |s|
|
||||
s.name 'Locomotive test website'
|
||||
s.subdomain 'test'
|
||||
s.after_build do |site_test|
|
||||
site_test.memberships.build :account => Factory("admin user"), :admin => true
|
||||
end
|
||||
end
|
||||
|
||||
# Accounts ##
|
||||
Factory.define :account do |a|
|
||||
a.name 'Bart Simpson'
|
||||
@ -14,6 +22,17 @@ Factory.define :account do |a|
|
||||
a.locale 'en'
|
||||
end
|
||||
|
||||
Factory.define "admin user", :parent => :account do |a|
|
||||
a.name "Admin"
|
||||
a.email "admin@locomotiveapp.org"
|
||||
end
|
||||
|
||||
Factory.define "frenchy user", :parent => :account do |a|
|
||||
a.name "Jean Claude"
|
||||
a.email "jean@frenchy.fr"
|
||||
a.locale 'fr'
|
||||
end
|
||||
|
||||
## Memberships ##
|
||||
Factory.define :membership do |m|
|
||||
m.association :account, :factory => :account
|
||||
|
Loading…
Reference in New Issue
Block a user