Sha256: 530a2d9a3e5c253865b9affd227b823d12234f166bab83f0487bbd260cb718f8

Contents?: true

Size: 754 Bytes

Versions: 10

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true
require 'test_helper'

module Shipit
  class CacheDeploySpecJobTest < ActiveSupport::TestCase
    setup do
      @stack = shipit_stacks(:shipit)
      @last_commit = @stack.commits.last
      @job = CacheDeploySpecJob.new
    end

    test "#perform checkout the repository to the last recorded commit and cache the deploy spec" do
      @stack.update!(cached_deploy_spec: DeploySpec.new('review' => { 'checklist' => %w(foo bar) }))

      dir = Pathname(Dir.tmpdir)
      StackCommands.any_instance.expects(:with_temporary_working_directory).with(commit: @last_commit).yields(dir)

      assert_equal %w(foo bar), @stack.checklist
      @job.perform(@stack)
      assert_equal [], @stack.reload.checklist
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.38.0 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.37.0 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.36.1 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.36.0 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.35.1 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.35.0 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.34.0 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.33.0 test/jobs/cache_deploy_spec_job_test.rb
shipit-engine-0.32.0 test/jobs/cache_deploy_spec_job_test.rb