Sha256: 3e2e4966ebb13f016ee8bca96f2f302f3c0e8df1af28982185e74a65064cea9c

Contents?: true

Size: 1.48 KB

Versions: 24

Compression:

Stored size: 1.48 KB

Contents

module Pageflow
  FactoryBot.define do
    factory :revision, :class => Revision do
      entry

      trait :frozen do
        frozen_at { 1.day.ago }
      end

      trait :published do
        frozen
        creator { create(:user) }
        published_at { 1.day.ago }
      end

      trait :not_yet_depublished do
        published
        published_until { 1.day.from_now }
      end

      trait :depublished do
        published
        published_until { 1.day.ago }
      end

      trait :user_snapshot do
        frozen
        snapshot_type { 'user' }
      end

      trait :auto_snapshot do
        frozen
        snapshot_type { 'auto' }
      end

      trait :with_home_button do
        configuration do
          {
            home_button_enabled: true,
            home_url: 'http://example.com'
          }
        end
      end

      trait :without_home_button do
        configuration do
          {
            home_button_enabled: false,
            home_url: 'http://example.com'
          }
        end
      end

      trait :with_overview_button do
        configuration do
          {
            overview_button_enabled: true
          }
        end
      end

      trait :without_overview_button do
        configuration do
          {
            overview_button_enabled: false
          }
        end
      end

      trait :with_meta_data do
        author { 'Some author' }
        publisher { 'Some publisher' }
        keywords { 'Some keywords' }
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
pageflow-17.0.4 spec/factories/revisions.rb
pageflow-17.0.3 spec/factories/revisions.rb
pageflow-17.0.2 spec/factories/revisions.rb
pageflow-17.0.1 spec/factories/revisions.rb
pageflow-17.0.0 spec/factories/revisions.rb
pageflow-16.2.0 spec/factories/revisions.rb
pageflow-16.1.0 spec/factories/revisions.rb
pageflow-16.0.0 spec/factories/revisions.rb
pageflow-15.8.0 spec/factories/revisions.rb
pageflow-15.7.1 spec/factories/revisions.rb
pageflow-15.7.0 spec/factories/revisions.rb
pageflow-15.6.1 spec/factories/revisions.rb
pageflow-15.6.0 spec/factories/revisions.rb
pageflow-15.5.0 spec/factories/revisions.rb
pageflow-15.4.0 spec/factories/revisions.rb
pageflow-15.3.0 spec/factories/revisions.rb
pageflow-15.2.2 spec/factories/revisions.rb
pageflow-15.2.1 spec/factories/revisions.rb
pageflow-15.2.0 spec/factories/revisions.rb
pageflow-15.1.2 spec/factories/revisions.rb