Sha256: 1a5e731bf0680bfee0c711e66ba2967badc1c438d4693f36f787c14916ad1569

Contents?: true

Size: 987 Bytes

Versions: 19

Compression:

Stored size: 987 Bytes

Contents

require 'spec_helper'

describe "Search 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(:client) 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! }

  describe "listing indexes" do
    it "returns an array of indexes" do
      indexes = client.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 {
        client.search(:notthere)
      }.should raise_error(Ridley::Errors::HTTPNotFound)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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