Sha256: 705dc033445c98b34f73a0cf516fa6319f55ab905fbd10816acf5ffd46400b7d

Contents?: true

Size: 710 Bytes

Versions: 6

Compression:

Stored size: 710 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::CollectionIndexer do
  let(:indexer) { described_class.new(collection) }
  let(:collection) { build(:collection) }

  describe "#generate_solr_document" do
    before do
      allow(collection).to receive(:bytes).and_return(1000)
      allow(CurationConcerns::ThumbnailPathService).to receive(:call).and_return("/downloads/1234?file=thumbnail")
    end
    subject { indexer.generate_solr_document }

    it "has required fields" do
      expect(subject.fetch('generic_type_sim')).to eq ["Collection"]
      expect(subject.fetch('bytes_is')).to eq(1000)
      expect(subject.fetch('thumbnail_path_ss')).to eq "/downloads/1234?file=thumbnail"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
curation_concerns-0.10.0 spec/indexers/collection_indexer_spec.rb
curation_concerns-0.9.0 spec/indexers/collection_indexer_spec.rb
curation_concerns-0.8.0 spec/indexers/collection_indexer_spec.rb
curation_concerns-0.7.0 spec/indexers/collection_indexer_spec.rb
curation_concerns-0.6.0 spec/indexers/collection_indexer_spec.rb
curation_concerns-0.5.0 spec/indexers/collection_indexer_spec.rb