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
|
s.created_at Time.now
|
||||||
end
|
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 ##
|
# Accounts ##
|
||||||
Factory.define :account do |a|
|
Factory.define :account do |a|
|
||||||
a.name 'Bart Simpson'
|
a.name 'Bart Simpson'
|
||||||
@ -14,6 +22,17 @@ Factory.define :account do |a|
|
|||||||
a.locale 'en'
|
a.locale 'en'
|
||||||
end
|
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 ##
|
## Memberships ##
|
||||||
Factory.define :membership do |m|
|
Factory.define :membership do |m|
|
||||||
m.association :account, :factory => :account
|
m.association :account, :factory => :account
|
||||||
|
Loading…
Reference in New Issue
Block a user