2022-03-02 08:16:31 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :ci_secure_file, class: 'Ci::SecureFile' do
|
2022-07-16 23:28:13 +05:30
|
|
|
sequence(:name) { |n| "file#{n}" }
|
2022-03-02 08:16:31 +05:30
|
|
|
file { fixture_file_upload('spec/fixtures/ci_secure_files/upload-keystore.jks', 'application/octet-stream') }
|
|
|
|
checksum { 'foo1234' }
|
|
|
|
project
|
2022-08-27 11:52:29 +05:30
|
|
|
|
|
|
|
trait :remote_store do
|
|
|
|
after(:create) do |ci_secure_file|
|
|
|
|
ci_secure_file.update!(file_store: ObjectStorage::Store::REMOTE)
|
|
|
|
end
|
|
|
|
end
|
2022-03-02 08:16:31 +05:30
|
|
|
end
|
2023-01-13 00:05:48 +05:30
|
|
|
|
|
|
|
factory :ci_secure_file_with_metadata, class: 'Ci::SecureFile' do
|
|
|
|
sequence(:name) { |n| "file#{n}.cer" }
|
|
|
|
file { fixture_file_upload('spec/fixtures/ci_secure_files/sample.cer', 'application/octet-stream') }
|
|
|
|
checksum { 'foo1234' }
|
|
|
|
project
|
|
|
|
|
|
|
|
after(:create, &:update_metadata!)
|
|
|
|
end
|
2022-03-02 08:16:31 +05:30
|
|
|
end
|