Sha256: fec6c5940e04b480874a07e1f02525dee3dbe5b9422e355b463a3e7e4143b4c3

Contents?: true

Size: 843 Bytes

Versions: 2

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

2 entries across 2 versions & 1 rubygems

Version Path
hydra-pcdm-0.11.0 spec/hydra/pcdm/pcdm_indexer_spec.rb
hydra-pcdm-0.10.0 spec/hydra/pcdm/pcdm_indexer_spec.rb