Sha256: ca8c42455f61f7aceb6faf5638ef222ebf24e9d249ffefcae5b7a121796c0995
Contents?: true
Size: 917 Bytes
Versions: 9
Compression:
Stored size: 917 Bytes
Contents
require 'spec_helper' describe Hydra::PCDM::CollectionIndexer do let(:collection) { Hydra::PCDM::Collection.new } let(:collection_ids) { %w(123 456) } let(:object_ids) { ['789'] } let(:member_ids) { %w(123 456 789) } let(:indexer) { described_class.new(collection) } before do allow(collection).to receive(:ordered_collection_ids).and_return(collection_ids) allow(collection).to receive(:ordered_object_ids).and_return(object_ids) allow(collection).to receive(:member_ids).and_return(member_ids) end describe '#generate_solr_document' do subject { indexer.generate_solr_document } it 'has fields' do expect(subject[Hydra::PCDM::Config.indexing_collection_ids_key]).to eq %w(123 456) expect(subject[Hydra::PCDM::Config.indexing_object_ids_key]).to eq ['789'] expect(subject[Hydra::PCDM::Config.indexing_member_ids_key]).to eq %w(123 456 789) end end end
Version data entries
9 entries across 9 versions & 1 rubygems