Upstream sync
This commit is contained in:
@@ -16,6 +16,10 @@ FactoryBot.define do
|
||||
release_type "talent"
|
||||
end
|
||||
|
||||
factory :medical_release_contract_template do
|
||||
release_type "medical"
|
||||
end
|
||||
|
||||
factory :material_release_contract_template do
|
||||
release_type "material"
|
||||
end
|
||||
|
||||
@@ -15,6 +15,13 @@ FactoryBot.define do
|
||||
end
|
||||
end
|
||||
|
||||
trait :with_photo do
|
||||
photos do
|
||||
path = Rails.root.join("spec", "fixtures", "files", "location_photo.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")
|
||||
|
||||
@@ -15,6 +15,14 @@ FactoryBot.define do
|
||||
end
|
||||
end
|
||||
|
||||
trait :with_photo do
|
||||
photos do
|
||||
path = Rails.root.join("spec", "fixtures", "files", "material_photo.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")
|
||||
|
||||
47
spec/factories/medical_releases.rb
Normal file
47
spec/factories/medical_releases.rb
Normal file
@@ -0,0 +1,47 @@
|
||||
FactoryBot.define do
|
||||
factory :medical_release do
|
||||
association :project
|
||||
|
||||
person_first_name "Jane"
|
||||
person_last_name "Doe"
|
||||
|
||||
photos [Rack::Test::UploadedFile.new(Rails.root.join("spec", "fixtures", "files", "person_photo.png"), "image/png")]
|
||||
|
||||
trait :native do
|
||||
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
|
||||
|
||||
factory :medical_release_with_contract_template do
|
||||
after(:build) do |medical_release, _|
|
||||
medical_release.contract_template = build(:medical_release_contract_template)
|
||||
end
|
||||
end
|
||||
|
||||
factory :medical_release_with_contract_template_and_photos do
|
||||
after(:build) do |medical_release, _|
|
||||
medical_release.contract_template = build(:medical_release_contract_template)
|
||||
path = Rails.root.join("spec", "fixtures", "files", "person_photo.png")
|
||||
medical_release.photos.attach Rack::Test::UploadedFile.new(path, "image/png")
|
||||
end
|
||||
end
|
||||
|
||||
factory :medical_release_with_photo do
|
||||
after(:build) do |medical_release, _|
|
||||
path = Rails.root.join("spec", "fixtures", "files", "person_photo.png")
|
||||
medical_release.photos.attach Rack::Test::UploadedFile.new(path, "image/png")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,3 @@
|
||||
require 'zoom_gateway'
|
||||
FactoryBot.define do
|
||||
factory :zoom_user do
|
||||
account_number ZoomGateway.ACCOUNT_NUMBER
|
||||
|
||||
Reference in New Issue
Block a user