FactoryGirl.define do factory :image do ignore do user {FactoryGirl.create(:user)} end sequence(:title) {|n| "Title #{n}"} sequence(:description) {|n| "Description #{n}"} rights { Sufia.config.cc_licenses.keys.first.dup } 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_image do visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE end factory :public_image do visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC end end end