Sha256: 0968f6d93382c18ff837aa75d4e126745ac60335fd73be320250f1ddce60f4fb
Contents?: true
Size: 783 Bytes
Versions: 8
Compression:
Stored size: 783 Bytes
Contents
require 'spec_helper' require 'conjur/dsl/runner' describe Conjur::DSL::Runner, logged_in: true do let(:filename) { nil } let(:runner) { Conjur::DSL::Runner.new script, filename } let(:script) { "user 'alice'" } before { Conjur.stub(:account).and_return "the-account" runner.stub(:api).and_return api } it "should store the api_key in the context keyed by roleid" do user = Conjur::User.new("alice") user.attributes = { "api_key" => "the-api-key" } api.should_receive(:user).with("alice").and_return double("alice-exists", exists?: false) api.should_receive(:create_user).with(id: "alice").and_return user runner.execute runner.context['api_keys'].should == { "the-account:user:alice" => "the-api-key" } end end
Version data entries
8 entries across 8 versions & 1 rubygems