Sha256: 706bdfae80c2b0027cb84858aba6162f7f9be30205ec29b3537131bde4aca1b7
Contents?: true
Size: 1.43 KB
Versions: 13
Compression:
Stored size: 1.43 KB
Contents
FactoryBot.define do factory :page do title 'Page' breadcrumb { title } slug { title.slugify } trait :with_parts do page_parts { [FactoryBot.create(:page_part, name: 'body')] } end trait :with_children do children { [FactoryBot.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
13 entries across 13 versions & 1 rubygems