Sha256: 2e61426b7809573870d82849ed5e5e6eb23438d0c899336262c8563776c816e9

Contents?: true

Size: 882 Bytes

Versions: 14

Compression:

Stored size: 882 Bytes

Contents

require 'spec_helper'

describe "Search 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 indexes" do
    it "returns an array of indexes" do
      indexes = connection.search_indexes

      expect(indexes).to include("role")
      expect(indexes).to include("node")
      expect(indexes).to include("client")
      expect(indexes).to include("environment")
    end
  end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ridley-5.1.1 spec/acceptance/search_resource_spec.rb
ridley-5.1.0 spec/acceptance/search_resource_spec.rb
ridley-5.0.0 spec/acceptance/search_resource_spec.rb
ridley-4.6.1 spec/acceptance/search_resource_spec.rb
ridley-4.6.0 spec/acceptance/search_resource_spec.rb
ridley-4.5.1 spec/acceptance/search_resource_spec.rb
ridley-4.5.0 spec/acceptance/search_resource_spec.rb
ridley-4.4.3 spec/acceptance/search_resource_spec.rb
ridley-4.4.2 spec/acceptance/search_resource_spec.rb
ridley-4.4.1 spec/acceptance/search_resource_spec.rb
ridley-4.4.0 spec/acceptance/search_resource_spec.rb
ridley-4.3.2 spec/acceptance/search_resource_spec.rb
ridley-4.3.1 spec/acceptance/search_resource_spec.rb
ridley-4.3.0 spec/acceptance/search_resource_spec.rb