Sha256: bfebd8af53f2c6c8816be6673e3eeb285ce47aea1b9442ae0a78ec6904d55d7b

Contents?: true

Size: 1.2 KB

Versions: 18

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

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

  let(:connection) do
    Ridley.new(
      server_url: server_url,
      client_name: client_name,
      client_key: client_key
    )
  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::DataBagResource)
      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

18 entries across 18 versions & 1 rubygems

Version Path
ridley-0.10.2 spec/acceptance/data_bag_resource_spec.rb
ridley-0.9.1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.10.1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.10.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.10.0.rc3 spec/acceptance/data_bag_resource_spec.rb
ridley-0.10.0.rc2 spec/acceptance/data_bag_resource_spec.rb
ridley-0.10.0.rc1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.9.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.8.6 spec/acceptance/data_bag_resource_spec.rb
ridley-0.8.5 spec/acceptance/data_bag_resource_spec.rb
ridley-0.8.3 spec/acceptance/data_bag_resource_spec.rb
ridley-0.8.2 spec/acceptance/data_bag_resource_spec.rb
ridley-0.8.1 spec/acceptance/data_bag_resource_spec.rb
ridley-0.8.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.7.0 spec/acceptance/data_bag_resource_spec.rb
ridley-0.7.0.rc4 spec/acceptance/data_bag_resource_spec.rb
ridley-0.7.0.rc3 spec/acceptance/data_bag_resource_spec.rb
ridley-0.7.0.rc1 spec/acceptance/data_bag_resource_spec.rb