Sha256: 1ab1c05b110e717a6f0d3bb77dd070d8205383e08b446766f5cce2a13c943255

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

FactoryBot.define do
  trait :content_item_defaults do
    heading { Faker::Lorem.word }
    show_heading { true }
    background { Katalyst::Content.config.backgrounds.sample }
    depth { 0 }
  end

  factory :katalyst_content_item, class: "Katalyst::Content::Item" do
    content_item_defaults
  end

  factory :katalyst_content_content, class: "Katalyst::Content::Content" do
    content_item_defaults
    content { Faker::Hacker.say_something_smart }
  end

  factory :katalyst_content_figure, class: "Katalyst::Content::Figure" do
    content_item_defaults
    image { image_upload }
    alt { Faker::Lorem.sentence }
    caption { Faker::Hacker.say_something_smart }
  end

  factory :katalyst_content_section, class: "Katalyst::Content::Section" do
    content_item_defaults
  end

  factory :katalyst_content_group, class: "Katalyst::Content::Group" do
    content_item_defaults
  end

  factory :katalyst_content_aside, class: "Katalyst::Content::Aside" do
    content_item_defaults
  end

  factory :katalyst_content_column, class: "Katalyst::Content::Column" do
    content_item_defaults
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
katalyst-content-1.0.2 spec/factories/katalyst/content/items.rb
katalyst-content-1.0.1 spec/factories/katalyst/content/items.rb
katalyst-content-1.0.0 spec/factories/katalyst/content/items.rb
katalyst-content-0.2.2 spec/factories/katalyst/content/items.rb
katalyst-content-0.2.1 spec/factories/katalyst/content/items.rb
katalyst-content-0.2.0 spec/factories/katalyst/content/items.rb