Sha256: 6b5768272ee2dd722de1ffb6659cea170233d42d3083d9de622f66310d593e59

Contents?: true

Size: 673 Bytes

Versions: 7

Compression:

Stored size: 673 Bytes

Contents

require 'spec_helper'

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

  let :solr do
    described_class.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

7 entries across 7 versions & 1 rubygems

Version Path
harvestdor-indexer-2.5.0 spec/unit/harvestdor-indexer-solr_spec.rb
harvestdor-indexer-2.4.0 spec/unit/harvestdor-indexer-solr_spec.rb
harvestdor-indexer-2.3.3 spec/unit/harvestdor-indexer-solr_spec.rb
harvestdor-indexer-2.3.2 spec/unit/harvestdor-indexer-solr_spec.rb
harvestdor-indexer-2.3.1 spec/unit/harvestdor-indexer-solr_spec.rb
harvestdor-indexer-2.3.0 spec/unit/harvestdor-indexer-solr_spec.rb
harvestdor-indexer-2.2.0 spec/unit/harvestdor-indexer-solr_spec.rb