Sha256: 00c424a69512abce557d50ce7f4ae9fcc8de8047d33cf42ee88fa76c90d07af3

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :page, class: "Archangel::Page" do
    site
    template { nil }
    sequence(:title) { |n| "Page #{n} Title" }
    sequence(:slug) { |n| "page-#{n}" }
    content { "<p>Content of the page</p>" }
    homepage { false }
    published_at { Time.current }

    trait :with_parent do
      association :parent, factory: :page
    end

    trait :with_template do
      association :template, factory: :template, partial: false
    end

    trait :homepage do
      homepage { true }
    end

    trait :unpublished do
      published_at { nil }
    end

    trait :future do
      published_at { 1.week.from_now }
    end

    trait :deleted do
      deleted_at { Time.current }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.3.0 lib/archangel/testing_support/factories/archangel_pages.rb