Sha256: f28e7bd8dc5b6e45b87fb1eeaf48969c85cfcbb12ad27b99784abbd7ae09b43f

Contents?: true

Size: 674 Bytes

Versions: 25

Compression:

Stored size: 674 Bytes

Contents

FactoryGirl.define do
  factory :content_element, class: Pulitzer::ContentElement do
    sequence(:label)  { |n| "Slide 1 content element #{n}" }
    title             { "Night's Watch" }
    body              { "I pledge my life and honor to the Night's Watch, for this night and all the nights to come" }
    association :content_element_type

    trait :video do
      body { "https://www.youtube.com/watch?v=yLisM2KPDIA" }
      association :content_element_type, :video
    end

    trait :image do
      image { Rack::Test::UploadedFile.new(File.join(Dir.pwd, "spec/support/files/sam_and_snow.jpg")) }
      association :content_element_type, :image
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pulitzer-0.2.1 spec/factories/content_element.rb
pulitzer-0.2.0 spec/factories/content_element.rb
pulitzer-0.1.10 spec/factories/content_element.rb
pulitzer-0.1.9 spec/factories/content_element.rb
pulitzer-0.1.8 spec/factories/content_element.rb