Initial commit
This commit is contained in:
27
spec/factories/directories.rb
Normal file
27
spec/factories/directories.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
FactoryBot.define do
|
||||
factory :directory do
|
||||
association :project
|
||||
association :user
|
||||
|
||||
name "Payrolls"
|
||||
category "Finance"
|
||||
|
||||
trait :for_manager do
|
||||
permissions "Account Managers & Project Managers"
|
||||
end
|
||||
|
||||
trait :for_account_manager do
|
||||
permissions "Account Managers Only"
|
||||
end
|
||||
|
||||
trait :with_files do
|
||||
files { [Rack::Test::UploadedFile.new('spec/fixtures/files/location_photo.png', 'image/png')] }
|
||||
end
|
||||
|
||||
file_names = ['location_photo.png', 'material_photo.png', 'person_photo.png']
|
||||
|
||||
trait :many_files do
|
||||
files { 30.times.map { Rack::Test::UploadedFile.new("spec/fixtures/files/#{file_names.sample}", 'image/png') } }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user