Sha256: 15a058559e8e16268b81deaf5910913f37a578459071e69f65fead0d2b6d01aa

Contents?: true

Size: 1.03 KB

Versions: 16

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe "Search 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! }

  describe "listing indexes" do
    it "returns an array of indexes" do
      indexes = connection.search_indexes

      indexes.should include("role")
      indexes.should include("node")
      indexes.should include("client")
      indexes.should include("environment")
    end
  end

  describe "searching an index that doesn't exist" do
    it "it raises a Ridley::Errors::HTTPNotFound error" do
      lambda {
        connection.search(:notthere)
      }.should raise_error(Ridley::Errors::HTTPNotFound)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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