Sha256: 0e816441de63f223cd0a7d50ece14e1b01661a028a91f639ad30b6d3807c5266
Contents?: true
Size: 880 Bytes
Versions: 7
Compression:
Stored size: 880 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: {} ).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' } ).and_return(post_response('the-id')) expect { invoke }.to write({ id: 'the-id' }).to(:stdout) end end end
Version data entries
7 entries across 7 versions & 1 rubygems