Sha256: efb785ee83df5ec3b0f9e07f26808bf42d582c088a70c22541c294655fcb2b2d
Contents?: true
Size: 1.21 KB
Versions: 10
Compression:
Stored size: 1.21 KB
Contents
require 'spec_helper' describe Krikri::Indexer do before(:all) do DatabaseCleaner.clean_with(:truncation) create(:krikri_enrichment_activity) end subject { described_class.new(opts) } enrichment_gen_uri = Krikri::Activity.base_uri / 5 behaves_opts = { generator_uri: enrichment_gen_uri, index_class: 'Krikri::QASearchIndex' } it_behaves_like 'a software agent', behaves_opts do after { clear_search_index } end # See mapper_agent_spec.rb regarding :opts and behaves_opts... let(:opts) do { generator_uri: enrichment_gen_uri, index_class: index_class.to_s } end let(:index_class) { Krikri::QASearchIndex } describe '::queue_name' do it { expect(described_class.queue_name.to_s).to eq 'indexing' } end describe '#run' do let(:agg) { build(:aggregation) } # :aggregation defined in DPLA::MAP let(:entity_enum) { Array.new(3, agg) } before do allow(subject.generator_activity).to receive(:entities) .and_return(entity_enum) end it 'indexes records' do expect(subject.index).to receive(:update_from_activity) .with(subject.generator_activity) subject.run end end end
Version data entries
10 entries across 10 versions & 1 rubygems