Sha256: 12f8eec13c3453fd52d6c766f5a36e5faf9143c7c3117d3de74f85cebce0999f

Contents?: true

Size: 692 Bytes

Versions: 37

Compression:

Stored size: 692 Bytes

Contents

require 'kontena/cli/nodes/create_command'

describe Kontena::Cli::Nodes::CreateCommand do
  include ClientHelpers
  include OutputHelpers

  it 'POSTs the node' do
    expect(client).to receive(:post).with('grids/test-grid/nodes', {name: 'node-4', labels: []})

    subject.run(['node-4'])
  end

  it 'POSTs the node with labels' do
    expect(client).to receive(:post).with('grids/test-grid/nodes', {name: 'node-4', labels: ['test=4']})

    subject.run(['-l', 'test=4', 'node-4'])
  end

  it 'POSTs with given token' do
    expect(client).to receive(:post).with('grids/test-grid/nodes', {name: 'node-4', labels: [], token: 'asdf'})

    subject.run(['--token=asdf', 'node-4'])
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
kontena-cli-1.5.4 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.4.rc1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.3 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.2 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.0 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.0.rc1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.0.pre5 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.0.pre4 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.0.pre3 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.0.pre2 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.5.0.pre1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.4.3 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.4.3.rc1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.4.2 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.4.2.rc1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.4.2.pre1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.4.1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.4.1.rc1 spec/kontena/cli/nodes/create_command_spec.rb
kontena-cli-1.4.1.pre1 spec/kontena/cli/nodes/create_command_spec.rb