Sha256: 5250f5bc54262a76752733b3ecbb9f6963cdb7ee68bb92d1110f37349e75862f

Contents?: true

Size: 1.1 KB

Versions: 55

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe "DataBag API operations", type: "acceptance" do
  let(:server_url)  { Ridley::RSpec::ChefServer.server_url }
  let(:client_name) { "reset" }
  let(:client_key)  { fixtures_path.join('reset.pem').to_s }
  let(:connection)  { Ridley.new(server_url: server_url, client_name: client_name, client_key: client_key) }

  describe "listing data bags" do
    context "when no data bags exist" do
      it "returns an empty array" do
        connection.data_bag.all.should have(0).items
      end
    end

    context "when the server has data bags" do
      before do
        chef_data_bag("ridley-one")
        chef_data_bag("ridley-two")
      end

      it "returns an array of data bags" do
        connection.data_bag.all.should each be_a(Ridley::DataBagObject)
      end

      it "returns all of the data bags on the server" do
        connection.data_bag.all.should have(2).items
      end
    end
  end

  describe "creating a data bag" do
    it "returns a Ridley::DataBagObject" do
      connection.data_bag.create(name: "ridley-one").should be_a(Ridley::DataBagObject)
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
ridley-4.2.0 spec/acceptance/data_bag_resource_spec.rb
ridley-4.1.2 spec/acceptance/data_bag_resource_spec.rb
ridley-4.1.1 spec/acceptance/data_bag_resource_spec.rb
ridley-4.1.0 spec/acceptance/data_bag_resource_spec.rb
ridley-4.0.0 spec/acceptance/data_bag_resource_spec.rb
ridley-3.1.0 spec/acceptance/data_bag_resource_spec.rb
ridley-3.0.0 spec/acceptance/data_bag_resource_spec.rb
ridley-3.0.0.rc1 spec/acceptance/data_bag_resource_spec.rb
ridley-2.5.1 spec/acceptance/data_bag_resource_spec.rb
ridley-2.5.0 spec/acceptance/data_bag_resource_spec.rb
ridley-2.4.4 spec/acceptance/data_bag_resource_spec.rb
ridley-2.4.3 spec/acceptance/data_bag_resource_spec.rb
ridley-2.4.2 spec/acceptance/data_bag_resource_spec.rb
ridley-2.4.1 spec/acceptance/data_bag_resource_spec.rb
ridley-2.4.0 spec/acceptance/data_bag_resource_spec.rb
ridley-2.3.0 spec/acceptance/data_bag_resource_spec.rb
ridley-2.2.0 spec/acceptance/data_bag_resource_spec.rb
ridley-2.1.0 spec/acceptance/data_bag_resource_spec.rb
ridley-2.0.0 spec/acceptance/data_bag_resource_spec.rb
ridley-1.7.1 spec/acceptance/data_bag_resource_spec.rb