2010-04-09 09:23:41 +00:00
|
|
|
## Site ##
|
|
|
|
Factory.define :site do |s|
|
|
|
|
s.name 'Acme Website'
|
|
|
|
s.subdomain 'acme'
|
|
|
|
s.created_at Time.now
|
|
|
|
end
|
|
|
|
|
2010-08-01 09:55:01 +00:00
|
|
|
Factory.define "test site", :parent => :site do |s|
|
|
|
|
s.name 'Locomotive test website'
|
|
|
|
s.subdomain 'test'
|
|
|
|
s.after_build do |site_test|
|
2010-08-01 10:37:49 +00:00
|
|
|
site_test.memberships.build :account => Account.where(:name => "Admin").first || Factory("admin user"), :admin => true
|
2010-08-01 09:55:01 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
Factory.define "another site", :parent => "test site" do |s|
|
|
|
|
s.name "Locomotive test website #2"
|
|
|
|
s.subdomain "test2"
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2010-04-13 13:24:12 +00:00
|
|
|
# Accounts ##
|
|
|
|
Factory.define :account do |a|
|
|
|
|
a.name 'Bart Simpson'
|
|
|
|
a.email 'bart@simpson.net'
|
|
|
|
a.password 'easyone'
|
|
|
|
a.password_confirmation 'easyone'
|
|
|
|
a.locale 'en'
|
|
|
|
end
|
2010-04-09 09:23:41 +00:00
|
|
|
|
2010-08-01 09:55:01 +00:00
|
|
|
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
|
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
|
2010-05-10 22:39:52 +00:00
|
|
|
## Memberships ##
|
|
|
|
Factory.define :membership do |m|
|
|
|
|
m.association :account, :factory => :account
|
|
|
|
m.admin true
|
|
|
|
end
|
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
|
2010-04-25 00:33:38 +00:00
|
|
|
## Pages ##
|
|
|
|
Factory.define :page do |p|
|
|
|
|
p.association :site, :factory => :site
|
|
|
|
p.title 'Home page'
|
2010-04-30 14:05:53 +00:00
|
|
|
p.slug 'index'
|
2010-05-02 23:33:17 +00:00
|
|
|
end
|
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
|
2010-05-02 23:33:17 +00:00
|
|
|
## Liquid templates ##
|
|
|
|
Factory.define :liquid_template do |t|
|
|
|
|
t.association :site, :factory => :site
|
|
|
|
t.name 'Simple one'
|
|
|
|
t.slug 'simple_one'
|
|
|
|
t.value %{simple liquid template}
|
|
|
|
end
|
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
|
2010-05-02 23:33:17 +00:00
|
|
|
## Layouts ##
|
|
|
|
Factory.define :layout do |l|
|
|
|
|
l.association :site, :factory => :site
|
|
|
|
l.name '1 main column + sidebar'
|
|
|
|
l.value %{<html>
|
|
|
|
<head>
|
2010-05-09 12:44:53 +00:00
|
|
|
<title>My website</title>
|
2010-05-02 23:33:17 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2010-07-06 15:00:02 +00:00
|
|
|
<div id="sidebar">\{\{ content_for_left_sidebar \}\}</div>
|
2010-07-13 00:46:17 +00:00
|
|
|
<div id="main">\{\{ content_for_layout | textile \}\}</div>
|
2010-05-02 23:33:17 +00:00
|
|
|
</body>
|
|
|
|
</html>}
|
|
|
|
end
|
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
|
2010-05-02 23:33:17 +00:00
|
|
|
## Snippets ##
|
|
|
|
Factory.define :snippet do |s|
|
|
|
|
s.association :site, :factory => :site
|
|
|
|
s.name 'My website title'
|
|
|
|
s.slug 'header'
|
2010-05-30 23:57:33 +00:00
|
|
|
s.value %{<title>Acme</title>}
|
2010-05-11 21:38:52 +00:00
|
|
|
end
|
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
|
2010-05-11 21:38:52 +00:00
|
|
|
## Theme assets ##
|
|
|
|
Factory.define :theme_asset do |a|
|
|
|
|
a.association :site
|
2010-05-17 20:46:41 +00:00
|
|
|
end
|
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
|
2010-05-24 00:18:23 +00:00
|
|
|
## Asset collections ##
|
2010-05-17 20:46:41 +00:00
|
|
|
Factory.define :asset_collection do |s|
|
|
|
|
s.association :site, :factory => :site
|
|
|
|
s.name 'Trip to Chicago'
|
|
|
|
end
|
2010-05-24 00:18:23 +00:00
|
|
|
|
2010-08-01 10:37:49 +00:00
|
|
|
|
2010-05-24 00:18:23 +00:00
|
|
|
## Content types ##
|
|
|
|
Factory.define :content_type do |t|
|
|
|
|
t.association :site, :factory => :site
|
|
|
|
t.name 'My project'
|
|
|
|
end
|
|
|
|
|