Sha256: 8cbb67b5c4d4171644b4a395bf8b75c16673bb9ac84b66ff73e033a406aa9b4a

Contents?: true

Size: 599 Bytes

Versions: 3

Compression:

Stored size: 599 Bytes

Contents

require 'spec_helper'

RSpec.describe NewspaperTitleIndexer do
  let(:ntitle) do
    NewspaperTitle.new(
      id: 'foo1234',
      title: ['Whatever'],
      publication_date_start: '1975',
      publication_date_end: '1995'
    )
  end
  let(:indexer) { described_class.new(ntitle) }

  describe '#generate_solr_document' do
    subject { indexer.generate_solr_document }

    it 'indexes date ranges correctly' do
      expect(subject['publication_date_start_dtsi']).to eq('1975-01-01T00:00:00Z')
      expect(subject['publication_date_end_dtsi']).to eq('1995-12-31T23:59:59Z')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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