Sha256: 3ae6506f9592bd33136f22b1247e4bfe0cbdcec045e87b3dfda2a71fff606b97

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'
require 'solr_wrapper'

RSpec.describe "Solr basic_configs" do
  SolrWrapper.default_instance_options = {
    port: SolrWrapper.default_solr_port,
    version: '8.11.3'
  } 
  SOLR_INSTANCE =  SolrWrapper.default_instance({})
  before(:all) { SOLR_INSTANCE.start }
  after(:all) { SOLR_INSTANCE.stop }

  context "basic configs" do
    subject { RSolr.connect url: "http://localhost:#{SOLR_INSTANCE.port}/solr/basic_configs/"}
    around(:each) do |example|
      SOLR_INSTANCE.with_collection(name: "basic_configs", dir: File.join(FIXTURES_DIR, "basic_configs")) do |coll|
        example.run
      end
    end
    describe "HEAD admin/ping" do
      it "should not raise an exception" do
        expect { subject.head('admin/ping') }.not_to raise_error
      end

      it "should not have a body" do
        expect(subject.head('admin/ping')).to be_kind_of RSolr::HashWithResponse
      end
    end
  end

  context "error handling" do
    subject { RSolr.connect url: "http://localhost:65432/solr/basic_configs/"}

    it "wraps connection errors" do
      expect { subject.head('admin/ping') }.to raise_error RSolr::Error::ConnectionRefused
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rsolr-2.6.0/spec/integration/solr5_spec.rb
rsolr-2.6.0 spec/integration/solr5_spec.rb