Sha256: 729d7d5c11fd6d695ba77892d7846b6d3e455a4b06e683f952348366f7e84df3
Contents?: true
Size: 928 Bytes
Versions: 9
Compression:
Stored size: 928 Bytes
Contents
require 'spec_helper' describe Spotlight::Resources::IiifHarvester do let(:exhibit) { FactoryGirl.create(:exhibit) } let(:harvester) { described_class.create(exhibit_id: exhibit.id, url: url) } describe 'Validation' do subject { harvester } context 'when given an invalid URL' do let(:url) { 'http://example.com' } it 'errors when the URL is not a IIIF URL' do expect(subject).to_not be_valid expect(subject.errors).to be_present expect(subject.errors[:url]).to eq ['Invalid IIIF URL'] end end end describe '#documents_to_index' do let(:url) { 'uri://for-top-level-collection' } before { stub_default_collection } subject { harvester.document_builder } it 'returns an Enumerator of all the solr documents' do expect(subject.documents_to_index).to be_a(Enumerator) expect(subject.documents_to_index.count).to eq 8 end end end
Version data entries
9 entries across 9 versions & 1 rubygems