Sha256: ab29ef74d8c040d042d14634925f61afb1fac80d17e81338ff6efbef43c3549d

Contents?: true

Size: 813 Bytes

Versions: 3

Compression:

Stored size: 813 Bytes

Contents

FactoryGirl.define do
  factory :article do
    ignore do
      user {FactoryGirl.create(:user)}
    end
    sequence(:title) {|n| "Title #{n}"}
    sequence(:abstract) {|n| "Abstract #{n}"}
    rights { Sufia.config.cc_licenses.keys.first }
    date_uploaded { Date.today }
    date_modified { Date.today }
    visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED

    before(:create) { |work, evaluator|
      work.apply_depositor_metadata(evaluator.user.user_key)
      work.contributors << FactoryGirl.create(:person)
    }

    factory :private_article do
      visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
    end
    factory :public_article do
      visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
curate-0.5.1 spec/factories/articles_factory.rb
curate-0.5.0 spec/factories/articles_factory.rb
curate-0.4.2 spec/factories/articles_factory.rb