Permalink
Browse files

Update Page and User factories

  • Loading branch information...
1 parent 7065e72 commit d8c62b2e4a7c61a3f1963ee7b8a904e8a0abdb33 @jomz jomz committed Feb 8, 2014
Showing with 42 additions and 5 deletions.
  1. +20 −4 spec/factories/page_factory.rb
  2. +22 −1 spec/factories/user_factory.rb
@@ -1,15 +1,31 @@
FactoryGirl.define do
factory :page do
- title 'New Page'
- slug 'page'
- breadcrumb 'New Page'
+ title 'Page'
+ breadcrumb { title }
+ slug { title.slugify }
+
status_id '1'
factory :page_with_layout do
layout
end
+
+ factory :page_with_page_parts do
+ page_parts
+ end
factory :file_not_found_page, :class => FileNotFoundPage do
end
+
+ factory :published_page do
+ status_id '100'
+ end
+
+ factory :home do |home|
+ title 'Home'
+ slug '/'
+ status_id '100'
+ parent_id nil
+ end
end
-end
+end
@@ -2,5 +2,26 @@
factory :user do
name 'User'
email 'email@test.com'
- end
+ login 'user'
+
+ factory :admin do
+ name 'Admin'
+ login 'admin'
+ email 'admin@example.com'
+ admin true
+ end
+
+ factory :designer do
+ name 'Designer'
+ login 'designer'
+ email ''
+ designer true
+ end
+
+ factory :non_admin do
+ name 'Non Admin'
+ login 'non_admin'
+ admin false
+ end
+ end
end

0 comments on commit d8c62b2

Please sign in to comment.