Sha256: f5e8d619ca9d0145b98fbde374d980da08e4675acb5b1e96af5bd621206f9e74
Contents?: true
Size: 1.43 KB
Versions: 31
Compression:
Stored size: 1.43 KB
Contents
FactoryGirl.define do factory :page do title 'Page' breadcrumb { title } slug { title.slugify } trait :with_parts do page_parts { [FactoryGirl.create(:page_part, name: 'body')] } end trait :with_children do children { [FactoryGirl.create(:page, :with_parts)] } end 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 :parent do end factory :published_page do status_id Status[:published].id factory :article do title { generate(:article_title)} slug { generate(:article_slug)} end factory :page_with_body_page_part do after(:create) { |page| page.parts.create(name: 'body', content: "#{page.title} body.") } end factory :page_with_body_and_sidebar_parts do after(:create) { |page| page.parts.create(name: 'body', content: "#{page.title} body.") } after(:create) { |page| page.parts.create(name: 'sidebar', content: "#{page.title} sidebar.") } end end factory :home do |home| title 'Home' slug '/' status_id Status[:published].id parent_id nil end end sequence :article_slug do |n| "article#{('-' + n.to_s) unless n == 1 }" end sequence :article_title do |n| "Article#{(' ' + n.to_s) unless n == 1 }" end end
Version data entries
31 entries across 31 versions & 1 rubygems