Sha256: 96d4d30b3bd5e755028eb327de78f9ad52213fb9fa63ab0a169d8d29e477b0a4

Contents?: true

Size: 1.25 KB

Versions: 23

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

describe "DataBag API operations", type: "acceptance" do
  let(:server_url) { "https://api.opscode.com" }
  let(:client_name) { "reset" }
  let(:client_key) { "/Users/reset/.chef/reset.pem" }
  let(:organization) { "ridley" }

  let(:connection) do
    Ridley.connection(
      server_url: server_url,
      client_name: client_name,
      client_key: client_key,
      organization: organization
    )
  end

  before(:all) { WebMock.allow_net_connect! }
  after(:all) { WebMock.disable_net_connect! }

  before(:each) do
    connection.data_bag.delete_all
  end

  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(:each) do
        connection.data_bag.create(name: "ridley-one")
        connection.data_bag.create(name: "ridley-two")
      end

      it "returns an array of data bags" do
        connection.data_bag.all.should each be_a(Ridley::DataBag)
      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
    pending
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ridley-0.7.0.beta spec/acceptance/data_bag_resource_spec.rb
ridley-0.6.3 spec/acceptance/data_bag_resource_spec.rb
ridley-0.6.2 spec/acceptance/data_bag_resource_spec.rb
ridley-0.6.1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.6.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.5.2 spec/acceptance/data_bag_resource_spec.rb
ridley-0.5.1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.5.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.4.1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.4.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.3.2 spec/acceptance/data_bag_resource_spec.rb
ridley-0.3.1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.3.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.2.2 spec/acceptance/data_bag_resource_spec.rb
ridley-0.2.1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.2.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.1.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.0.6 spec/acceptance/data_bag_resource_spec.rb
ridley-0.0.5 spec/acceptance/data_bag_resource_spec.rb
ridley-0.0.4 spec/acceptance/data_bag_resource_spec.rb