Sha256: 976aa98c90d089f4a59231cbca784890640f0df9abae518b8593be2d54714efa

Contents?: true

Size: 1 KB

Versions: 36

Compression:

Stored size: 1 KB

Contents

module Pageflow
  FactoryGirl.define do
    hosted_file_model = Class.new(ActiveRecord::Base) do
      self.table_name = 'test_hosted_files'
      include HostedFile
    end

    factory :hosted_file, class: hosted_file_model do
      trait :on_filesystem do
        attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'image.png'))
        attachment_on_s3 nil
        state 'not_uploaded_to_s3'
      end

      trait :uploading_to_s3_failed do
        attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'image.png'))
        attachment_on_s3 nil
        state 'uploading_to_s3_failed'
      end

      trait :uploaded_to_s3 do
        attachment_on_s3 File.open(Engine.root.join('spec', 'fixtures', 'image.png'))
        state 'uploaded_to_s3'
      end

      trait :with_overridden_keep_on_filesystem do
        after(:build) do |hosted_file|
          def hosted_file.keep_on_filesystem_after_upload_to_s3?
            true
          end
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
pageflow-12.6.0 spec/factories/hosted_files.rb
pageflow-12.5.0 spec/factories/hosted_files.rb
pageflow-12.4.1 spec/factories/hosted_files.rb
pageflow-12.4.0 spec/factories/hosted_files.rb
pageflow-12.3.0 spec/factories/hosted_files.rb
pageflow-12.2.0 spec/factories/hosted_files.rb
pageflow-12.1.0 spec/factories/hosted_files.rb
pageflow-12.0.4 spec/factories/hosted_files.rb
pageflow-12.0.3 spec/factories/hosted_files.rb
pageflow-12.0.2 spec/factories/hosted_files.rb
pageflow-12.0.1 spec/factories/hosted_files.rb
pageflow-12.0.0 spec/factories/hosted_files.rb
pageflow-12.0.0.rc7 spec/factories/hosted_files.rb
pageflow-12.0.0.rc6 spec/factories/hosted_files.rb
pageflow-0.11.4 spec/factories/hosted_files.rb
pageflow-12.0.0.rc5 spec/factories/hosted_files.rb
pageflow-12.0.0.rc4 spec/factories/hosted_files.rb
pageflow-12.0.0.rc3 spec/factories/hosted_files.rb
pageflow-12.0.0.rc2 spec/factories/hosted_files.rb
pageflow-12.0.0.rc1 spec/factories/hosted_files.rb