Sha256: 53fe8ad618b843b965f12ce2bcd39ac2ae0340361054dc3d40671d00ba556821

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

require 'spec_helper'

describe Harvestdor::Indexer::Solr do
  let :indexer do
    double(logger: Logger.new("/dev/null"))
  end

  let :solr do
    Harvestdor::Indexer::Solr.new indexer
  end

  # The method that sends the solr document to solr
  describe "#add" do
    let(:doc_hash) do
      {
        :id => "whatever",
        :modsxml => 'whatever',
        :title_display => 'title',
        :pub_year_tisim => 'some year',
        :author_person_display => 'author',
        :format => 'Image',
        :language => 'English'
      }
    end

    it "sends an add request to the solr_client" do
      expect(solr.client).to receive(:add).with(doc_hash)
      solr.add(doc_hash)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
harvestdor-indexer-2.1.1 spec/unit/harvestdor-indexer-solr_spec.rb
harvestdor-indexer-2.1.0 spec/unit/harvestdor-indexer-solr_spec.rb
harvestdor-indexer-2.0.0 spec/unit/harvestdor-indexer-solr_spec.rb