Sha256: 10813c4c6ee3455622d0b7fa20368ff6523931fe3a356478d2fd4aa9df241cc2

Contents?: true

Size: 843 Bytes

Versions: 6

Compression:

Stored size: 843 Bytes

Contents

require 'spec_helper'

describe Hydra::PCDM::PCDMIndexer do
  let(:collection) { Hydra::PCDM::Collection.new }
  let(:member_ids) { %w[123 456 789] }
  let(:indexer) { described_class.new(collection) }
  let(:collection1)   { Hydra::PCDM::Collection.new(id: 'abc') }
  let(:collection2)   { Hydra::PCDM::Collection.new(id: 'def') }

  before do
    allow(collection).to receive(:member_ids).and_return(member_ids)
    allow(collection).to receive(:member_of_collection_ids).and_return([collection1.id, collection2.id])
  end

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

    it 'has fields' do
      expect(subject[Hydra::PCDM::Config.indexing_member_ids_key]).to eq %w[123 456 789]
      expect(subject[Hydra::PCDM::Config.indexing_member_of_collection_ids_key]).to eq %w[abc def]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hydra-pcdm-1.4.0 spec/hydra/pcdm/pcdm_indexer_spec.rb
hydra-pcdm-1.3.0 spec/hydra/pcdm/pcdm_indexer_spec.rb
hydra-pcdm-1.2.0 spec/hydra/pcdm/pcdm_indexer_spec.rb
hydra-pcdm-1.1.0 spec/hydra/pcdm/pcdm_indexer_spec.rb
hydra-pcdm-1.0.1 spec/hydra/pcdm/pcdm_indexer_spec.rb
hydra-pcdm-1.0.0 spec/hydra/pcdm/pcdm_indexer_spec.rb