Sha256: f22ee47b307c929314260062f9d47a5d1a1d3e3048a86aefd1f92f2523d1d84a

Contents?: true

Size: 765 Bytes

Versions: 13

Compression:

Stored size: 765 Bytes

Contents

require "kontena/cli/grids/trusted_subnet_command"
require "kontena/cli/grids/trusted_subnets/remove_command"

describe Kontena::Cli::Grids::TrustedSubnets::RemoveCommand do

  include ClientHelpers

  describe '#execute' do
    it 'requires grid as param' do
      expect {
        subject.run([])
      }.to raise_error(Clamp::UsageError)
    end

    it 'removes subnet from grid' do
      allow(client).to receive(:get).with("grids/my-grid").and_return(
        'trusted_subnets' => ['192.168.12.0/24', '192.168.50.0/24']
      )
      expect(client).to receive(:put).with(
        'grids/my-grid', hash_including({trusted_subnets: [
          '192.168.12.0/24'
        ]})
      )
      subject.run(['--force', 'my-grid', '192.168.50.0/24'])
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
kontena-cli-1.2.2 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.2.rc2 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.2.rc1 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.1 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.1.rc1 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.0 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.0.rc3 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.0.rc2 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.0.rc1 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.0.pre3 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.0.pre2 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.0.pre1 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb
kontena-cli-1.2.0.dev1 spec/kontena/cli/grids/trusted_subnets/remove_command_spec.rb