Sha256: 41176e25f43a9d0f6a18bb624865a631609db0c100ffc33a95701bb3b01553f3

Contents?: true

Size: 789 Bytes

Versions: 3

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'

RSpec.describe NewspaperWorks::NewspaperCoreIndexer do
  let(:geonames_uri) { 'http://sws.geonames.org/4950065/' }
  let(:pop) { Hyrax::ControlledVocabularies::Location.new(geonames_uri) }
  let(:article) do
    NewspaperArticle.new(
      id: 'foo1234',
      title: ['Whatever'],
      place_of_publication: pop
    )
  end
  let(:indexer) { described_class.new(article) }

  describe '#generate_solr_document' do
    subject { indexer.generate_solr_document }
    it 'processes place_of_publication field' do
      expect(subject['place_of_publication_tesim']).to include(geonames_uri)
      expect(subject['place_of_publication_city_sim']).to include('Salem')
      expect(subject['place_of_publication_state_sim']).to include('Massachusetts')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newspaper_works-1.0.1 spec/indexers/newspaper_works/newspaper_core_indexer_spec.rb
newspaper_works-1.0.0 spec/indexers/newspaper_works/newspaper_core_indexer_spec.rb
newspaper_works-0.1.0 spec/indexers/newspaper_works/newspaper_core_indexer_spec.rb