Skip to content

Commit

Permalink
[WIP] Increasing the coverage for ExhibitProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgriffiniii committed Jun 18, 2018
1 parent 0e78a54 commit 0d06626
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/models/exhibit_proxy_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'rails_helper'

describe ExhibitProxy do
subject(:exhibit_proxy) { described_class.new(exhibit) }

let(:exhibit) { instance_double(Spotlight::Exhibit) }
#let(:collection_manifest) { instance_double(CollectionManifest) }
let(:collection_manifest) { double }

before do
allow(exhibit).to receive(:slug).and_return('test-exhibit')
allow(collection_manifest).to receive(:manifests).and_return([{ '@id' => 'uri://to-manifest1' }])
allow(CollectionManifest).to receive(:find_by_slug).and_return(collection_manifest)
end

describe '#document_builder' do
it 'constructs a DummyDocumentBuilder using the members in the Manifest' do
expect(exhibit_proxy.document_builder).to be_a ExhibitProxy::DummyDocumentBuilder
expect(exhibit_proxy.document_builder.members).to eq ['uri://to-manifest1']
expect(exhibit_proxy.document_builder.documents_to_index).to eq ['uri://to-manifest1']
end
end
end

0 comments on commit 0d06626

Please sign in to comment.