Sha256: b982c44e6e04ce9ec244d05e2d452be0203d8d4525c7cdaced6c406f2038f829

Contents?: true

Size: 872 Bytes

Versions: 8

Compression:

Stored size: 872 Bytes

Contents

FactoryGirl.define do
  factory :work, aliases: [:generic_work, :private_generic_work], class: GenericWork do
    transient do
      user { FactoryGirl.create(:user) }
    end

    title ["Test title"]
    visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE

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

    factory :public_generic_work, aliases: [:public_work] do
      visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
    end

    factory :registered_generic_work do
      read_groups ["registered"]
    end

    factory :work_with_one_file do
      before(:create) do |work, evaluator|
        work.ordered_members << FactoryGirl.create(:file_set, user: evaluator.user, title: ['A Contained FileSet'], label: 'filename.pdf')
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.1.0 spec/factories/generic_works.rb
sufia-7.0.0 spec/factories/generic_works.rb
sufia-7.0.0.rc2 spec/factories/generic_works.rb
sufia-7.0.0.rc1 spec/factories/generic_works.rb
sufia-7.0.0.beta4 spec/factories/generic_works.rb
sufia-7.0.0.beta3 spec/factories/generic_works.rb
sufia-7.0.0.beta2 spec/factories/generic_works.rb
sufia-7.0.0.beta1 spec/factories/generic_works.rb