Sha256: 65c5b403f0396706f279d3c306973c254d94ab47bd3900038229b46c2b4be4af

Contents?: true

Size: 938 Bytes

Versions: 10

Compression:

Stored size: 938 Bytes

Contents

require 'spec_helper'

describe Conjur::Command::Hosts, logged_in: true do
  let(:collection_url) { "https://core.example.com/hosts" }
  
  describe_command "host:create" do
    it "lets the server assign the id" do
     expect(RestClient::Request).to receive(:execute).with({
        method: :post,
        url: collection_url,
        headers: {},
        payload: {}
        }.merge(cert_store_options)).and_return(post_response('assigned-id'))

      expect { invoke }.to write({ id: 'assigned-id' }).to(:stdout)
    end
  end
  describe_command "host:create the-id" do
    it "propagates the user-assigned id" do
     expect(RestClient::Request).to receive(:execute).with({
        method: :post,
        url: collection_url,
        headers: {},
        payload: { id: 'the-id' }
      }.merge(cert_store_options)).and_return(post_response('the-id'))

      expect { invoke }.to write({ id: 'the-id' }).to(:stdout)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
conjur-cli-4.27.0 spec/command/hosts_spec.rb
conjur-cli-4.26.0 spec/command/hosts_spec.rb
conjur-cli-4.25.2 spec/command/hosts_spec.rb
conjur-cli-4.25.1 spec/command/hosts_spec.rb
conjur-cli-4.25.0 spec/command/hosts_spec.rb
conjur-cli-4.24.0 spec/command/hosts_spec.rb
conjur-cli-4.23.0 spec/command/hosts_spec.rb
conjur-cli-4.22.0 spec/command/hosts_spec.rb
conjur-cli-4.21.1 spec/command/hosts_spec.rb
conjur-cli-4.21.0 spec/command/hosts_spec.rb