spec/chef-vault/item_spec.rb in chef-vault-2.9.1 vs spec/chef-vault/item_spec.rb in chef-vault-2.9.2
- old
+ new
@@ -208,11 +208,11 @@
expect(item.node_name).to eq("baz")
expect(item.client_key_path).to eq("/foo/client.pem")
end
end
- describe '#save' do
+ describe "#save" do
context 'when item["id"] is bar.bar' do
let(:item) { ChefVault::Item.new("foo", "bar.bar") }
it "raises an error on save with an invalid item['id']" do
expect { item.save }.to raise_error
@@ -225,11 +225,11 @@
item.keys["clients"] = %w{admin}
expect { item.save }.to raise_error(ChefVault::Exceptions::IdMismatch)
end
end
- describe '#refresh' do
+ describe "#refresh" do
it "saves only the keys" do
keys = double("keys",
search_query: "*:*",
add: nil,
@@ -254,11 +254,11 @@
expect(keys).to receive(:save)
item.refresh
end
end
- describe '#clients' do
+ describe "#clients" do
include BorkedNodeWithoutPublicKey
it "should not blow up when search returns a node without a public key" do
# try to set clients when we know a node is missing a public key
# this should not die as of v2.4.1
@@ -282,19 +282,19 @@
@vaultitem.clients(client)
expect(@vaultitem.clients).to include("foo")
end
end
- describe '#admins' do
+ describe "#admins" do
include BorkedNodeWithoutPublicKey
it "should blow up if you try to use a node without a public key as an admin" do
expect { @vaultitem.admins("foo,bar") }
.to raise_error(ChefVault::Exceptions::AdminNotFound)
end
end
- describe '#raw_keys' do
+ describe "#raw_keys" do
it "should return the keys of the underlying data bag item" do
item = ChefVault::Item.new("foo", "bar")
item["foo"] = "bar"
expect(item.raw_keys).to eq(%w{id foo})
end