Sha256: 517c1a7256d78b804971e4116a9a0f587f869dee630260fa9705f1a28a18cde9
Contents?: true
Size: 967 Bytes
Versions: 18
Compression:
Stored size: 967 Bytes
Contents
require 'spec_helper' describe Conjur::Command::Elevate do describe_command "elevate user show alice" do include_context "with mock authn" let(:token) { {login: 'dknuth'} } before{ expect(Conjur::Authn).to receive(:connect).and_return(api) } it "invokes the sub-command with X-Conjur-Privilege header" do allow_any_instance_of(Conjur::API).to receive(:token).and_return(token) expect(Conjur::Command).to receive(:api=) do |api| expect(api.api_key).to eq("sekrit") expect(api.privilege).to eq("elevate") end.and_call_original expect(RestClient::Request).to receive(:execute).with({ method: :get, url: "https://core.example.com/api/users/alice", username: "dknuth", headers: {:authorization=>"Token token=\"eyJsb2dpbiI6ImRrbnV0aCJ9\"", x_conjur_privilege: "elevate"} }).and_return(double(:response, body: "[]")) invoke end end end
Version data entries
18 entries across 18 versions & 1 rubygems