Sha256: c7d791b6dcd15466f9894121808a74659d3a063c31628b1911bb24e8d199ba87

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Shipit
  module ProvisioningHandler
    class UnregisteredProvisioningHandlerTest < ActiveSupport::TestCase
      test "#up stops transitions" do
        stack = shipit_stacks(:shipit)
        stack.update(provision_status: :deprovisioned)

        assert_throws :halt do
          UnregisteredProvisioningHandler.new(stack).up
        end
      end

      test "#up locks the stack" do
        stack = shipit_stacks(:shipit)
        stack.update(provision_status: :deprovisioned)

        assert_changes -> { stack.locked? }, from: false, to: true do
          catch :halt do
            UnregisteredProvisioningHandler.new(stack).up
          end
        end
      end

      test "#down stops transitions" do
        stack = shipit_stacks(:shipit)
        stack.update(provision_status: :deprovisioned)

        assert_throws :halt do
          UnregisteredProvisioningHandler.new(stack).down
        end
      end

      test "#down prevents transitions" do
        stack = shipit_stacks(:shipit)
        stack.update(provision_status: :deprovisioned)

        assert_changes -> { stack.locked? }, from: false, to: true do
          catch :halt do
            UnregisteredProvisioningHandler.new(stack).down
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
shipit-engine-0.38.0 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
shipit-engine-0.37.0 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
shipit-engine-0.36.1 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
shipit-engine-0.36.0 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
shipit-engine-0.35.1 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
shipit-engine-0.35.0 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
shipit-engine-0.34.0 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb
shipit-engine-0.33.0 test/models/shipit/provisioning_handler/unregistered_provisioning_handler_test.rb