# frozen_string_literal: true require 'test_helper' class DeployZipTest < ActiveSupport::TestCase setup do @site = create :site @deploy_zip = @site.deploys.create(type: 'DeployZip') end teardown do @site&.destroy end test 'el nombre es el hostname.zip' do assert_equal "#{@site.hostname}.zip", @deploy_zip.hostname end test 'se puede deployear' do # Primero tenemos que generar el sitio assert @site.deploy_local.deploy assert @deploy_zip.deploy assert File.file?(@deploy_zip.path) assert_equal 'application/zip', `file --mime-type "#{@deploy_zip.path}"`.split.last assert_equal 1, @deploy_zip.build_stats.count assert @deploy_zip.build_stats.map(&:bytes).inject(:+).positive? assert @deploy_zip.build_stats.map(&:seconds).inject(:+).positive? end end