Sha256: 776d37a4f699582eccb81bb5b13c3890ad78074f94388a08d1e1b761bab95f65

Contents?: true

Size: 518 Bytes

Versions: 5

Compression:

Stored size: 518 Bytes

Contents

include ActionDispatch::TestProcess

FactoryGirl.define do
  # to_create do |instance|
  #   raise "Save failed for #{instance.class} (#{instance.errors.full_messages.inspect})" if !instance.save
  # end

  factory :polygallery_photo, :class => Polygallery::Photo do
    caption { [nil, MFaker::BaconIpsum.paragraph].sample }
    # photo   {
    #   File.new(get_random_photo) if photo_to_upload.nil? && photo_remote_url.nil? }
    photo_to_upload { get_random_photo if photo.nil? && photo_remote_url.nil? }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
polygallery-0.4.8 lib/polygallery/factories/polygallery/photos.rb
polygallery-0.4.7 lib/polygallery/factories/polygallery/photos.rb
polygallery-0.4.6 lib/polygallery/factories/polygallery/photos.rb
polygallery-0.4.5 lib/polygallery/factories/polygallery/photos.rb
polygallery-0.4.4 lib/polygallery/factories/polygallery/photos.rb