Sha256: 7c3c1fb67a535af9f7f14bdf2f89b5349f945f7d43495dc0fbccf13f0050db92

Contents?: true

Size: 557 Bytes

Versions: 3

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true
FactoryBot.define do
  factory :hyrax_embargo, class: "Hyrax::Embargo" do
    embargo_release_date      { (Time.zone.today + 10).to_datetime }
    visibility_after_embargo  { 'open' }
    visibility_during_embargo { 'authenticated' }

    to_create do |instance|
      saved_instance = Valkyrie.config.metadata_adapter.persister.save(resource: instance)
      instance.id = saved_instance.id
      saved_instance
    end

    trait :expired do
      embargo_release_date { (Time.zone.today - 1).to_datetime }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hyrax-5.0.1 lib/hyrax/specs/shared_specs/factories/hyrax_embargo.rb
hyrax-5.0.0 spec/factories/hyrax_embargo.rb
hyrax-5.0.0.rc3 spec/factories/hyrax_embargo.rb