Sha256: d531740a23932665deab4771b6e0b0c9ac93486400f1d3e5d71fcd9969ea76c1

Contents?: true

Size: 911 Bytes

Versions: 64

Compression:

Stored size: 911 Bytes

Contents

FactoryGirl.define do
  # The ::FileSet model is defined in .internal_test_app/app/models by the
  # curation_concerns:install generator.
  factory :file_set, class: FileSet do
    transient do
      user { FactoryGirl.create(:user) }
      content nil
    end

    after(:create) do |file, evaluator|
      if evaluator.content
        Hydra::Works::UploadFileToFileSet.call(file, evaluator.content)
      end
    end

    factory :file_with_work do
      after(:build) do |file, _evaluator|
        file.title = ['testfile']
      end
      after(:create) do |file, evaluator|
        if evaluator.content
          Hydra::Works::UploadFileToFileSet.call(file, evaluator.content)
        end
        FactoryGirl.create(:generic_work, user: evaluator.user).members << file
      end
    end

    after(:build) do |file, evaluator|
      file.apply_depositor_metadata(evaluator.user.user_key)
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
curation_concerns-0.14.0.pre3 spec/factories/file_sets.rb
curation_concerns-0.14.0.pre2 spec/factories/file_sets.rb
curation_concerns-0.14.0.pre1 spec/factories/file_sets.rb
curation_concerns-0.13.1 spec/factories/file_sets.rb
curation_concerns-0.13.0 spec/factories/file_sets.rb
curation_concerns-0.12.0 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre9 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre8 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre7 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre6 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre5 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre4 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre3 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre2 spec/factories/file_sets.rb
curation_concerns-0.12.0.pre1 spec/factories/file_sets.rb
curation_concerns-0.11.0 spec/factories/file_sets.rb
curation_concerns-0.11.0.rc1 spec/factories/file_sets.rb
curation_concerns-0.10.0 spec/factories/file_sets.rb
curation_concerns-0.9.0 spec/factories/file_sets.rb
curation_concerns-0.8.0 spec/factories/file_sets.rb