Sha256: 7ec48443029767c4a2623663103ac230c9b6b457e4b58f8c29abead82e34516e

Contents?: true

Size: 738 Bytes

Versions: 10

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true
require 'test_helper'

module Shipit
  class DestroyStackJobTest < ActiveSupport::TestCase
    setup do
      @job = DestroyStackJob.new
      @stack = Stack.first
    end

    test "perform destroys the received stack" do
      Shipit.github.api.expects(:remove_hook).times(@stack.github_hooks.count)

      assert_difference -> { Stack.count }, -1 do
        @job.perform(@stack)
      end
    end

    test "perform destroys the CommitDeployments of the received stack" do
      stack = shipit_stacks(:shipit)
      Shipit.legacy_github_api.stubs(:remove_hook)

      assert_changes -> { CommitDeployment.count }, 'CommitDeployments not deleted' do
        @job.perform(stack)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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