106 lines
2.9 KiB
Ruby
106 lines
2.9 KiB
Ruby
FactoryBot.define do
|
|
factory :appearance_release do
|
|
association :project
|
|
|
|
person_first_name "Jane"
|
|
person_last_name "Doe"
|
|
|
|
person_photo do
|
|
path = Rails.root.join("spec", "fixtures", "files", "person_photo.png")
|
|
Rack::Test::UploadedFile.new(path, "image/png")
|
|
end
|
|
|
|
trait :native do
|
|
person_address_street1 "St1"
|
|
person_address_street2 "St2"
|
|
person_address_city "City"
|
|
person_address_state "State"
|
|
person_address_zip "ZIP"
|
|
person_address_country "Country"
|
|
person_phone "123-555-6789"
|
|
|
|
signature do
|
|
path = Rails.root.join("spec", "fixtures", "files", "signature.png")
|
|
Rack::Test::UploadedFile.new(path, "image/png")
|
|
end
|
|
end
|
|
|
|
trait :non_native do
|
|
contract do
|
|
path = Rails.root.join("spec", "fixtures", "files", "contract.pdf")
|
|
Rack::Test::UploadedFile.new(path, "application/pdf")
|
|
end
|
|
end
|
|
|
|
trait :minor do
|
|
minor true
|
|
guardian_first_name "Jamie"
|
|
guardian_last_name "Doe"
|
|
guardian_address_street1 "St1"
|
|
guardian_address_street2 "St2"
|
|
guardian_address_city "City"
|
|
guardian_address_state "State"
|
|
guardian_address_zip "ZIP"
|
|
guardian_address_country "Country"
|
|
guardian_phone "123-555-1234"
|
|
guardian_email "guardian@galaxy.all"
|
|
end
|
|
|
|
trait :minor_with_guardian_photo do
|
|
minor true
|
|
guardian_first_name "Jamie"
|
|
guardian_last_name "Doe"
|
|
guardian_phone "123-555-1234"
|
|
guardian_email "guardian@galaxy.all"
|
|
guardian_address_street1 "St1"
|
|
guardian_address_street2 "St2"
|
|
guardian_address_city "City"
|
|
guardian_address_state "State"
|
|
guardian_address_zip "ZIP"
|
|
guardian_address_country "Country"
|
|
guardian_photo do
|
|
path = Rails.root.join("spec", "fixtures", "files", "pratt.jpg")
|
|
Rack::Test::UploadedFile.new(path, "image/jpeg")
|
|
end
|
|
end
|
|
|
|
trait :without_person_photo do
|
|
person_photo nil
|
|
end
|
|
trait :with_person_photo do
|
|
person_photo do
|
|
path = Rails.root.join("spec", "fixtures", "files", "person_photo.png")
|
|
Rack::Test::UploadedFile.new(path, "image/png")
|
|
end
|
|
end
|
|
|
|
trait :with_person_photo_only do
|
|
end
|
|
|
|
factory :appearance_release_with_contract_template do
|
|
after(:build) do |appearance_release, _|
|
|
appearance_release.contract_template = build(:appearance_release_contract_template)
|
|
end
|
|
end
|
|
|
|
factory :appearance_release_import do
|
|
person_photo nil
|
|
|
|
trait :with_headshot do
|
|
person_photo do
|
|
path = Rails.root.join("spec", "fixtures", "files", "person_photo.png")
|
|
Rack::Test::UploadedFile.new(path, "image/png")
|
|
end
|
|
end
|
|
|
|
trait :with_contract do
|
|
contract do
|
|
path = Rails.root.join("spec", "fixtures", "files", "AppearanceRelease.pdf")
|
|
Rack::Test::UploadedFile.new(path, "application/pdf")
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|