2020-11-24 15:15:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :pages_deployment, class: 'PagesDeployment' do
|
|
|
|
project
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
after(:build) do |deployment, _evaluator|
|
2021-01-29 00:20:46 +05:30
|
|
|
filepath = Rails.root.join("spec/fixtures/pages.zip")
|
|
|
|
|
|
|
|
deployment.file = fixture_file_upload(filepath)
|
|
|
|
deployment.file_sha256 = Digest::SHA256.file(filepath).hexdigest
|
|
|
|
::Zip::File.open(filepath) do |zip_archive|
|
|
|
|
deployment.file_count = zip_archive.count
|
|
|
|
end
|
2021-01-03 14:25:43 +05:30
|
|
|
end
|
2020-11-24 15:15:51 +05:30
|
|
|
end
|
|
|
|
end
|