5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 12:36:22 +00:00
panel/test/models/deploy_local_test.rb
2019-10-01 16:41:33 -03:00

24 lines
706 B
Ruby

# frozen_string_literal: true
class DeployLocalTest < ActiveSupport::TestCase
test 'se puede deployear' do
site = create :site
local = create :deploy_local, site: site
deploy = create :deploy_zip, site: site
# Primero tenemos que generar el sitio
local.deploy
escaped_path = Shellwords.escape(deploy.path)
assert deploy.deploy
assert File.file?(deploy.path)
assert_equal 'application/zip',
`file --mime-type "#{escaped_path}"`.split(' ').last
assert_equal 1, deploy.build_stats.count
assert deploy.build_stats.map(&:bytes).inject(:+).positive?
assert deploy.build_stats.map(&:seconds).inject(:+).positive?
local.destroy
end
end