Sha256: ebb4752b451683bc7d6fce51e6a7e1dbc3718ce2eae9843d0d127d025f794f0a
Contents?: true
Size: 1.04 KB
Versions: 8
Compression:
Stored size: 1.04 KB
Contents
require 'spec_helper' describe Spotlight::Resources::IiifHarvester do let(:exhibit) { FactoryBot.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 before do stub_request(:head, 'http://example.com').to_return(status: 200, headers: { 'Content-Type' => 'text/html' }) end 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
8 entries across 8 versions & 1 rubygems