Sha256: 12becace00721659067e5c97d1ada4e7dceca4ebd5566631dfa7cf40e7f5b57a
Contents?: true
Size: 1.19 KB
Versions: 24
Compression:
Stored size: 1.19 KB
Contents
require 'spec_helper' describe Blacklight::Gallery::OpenseadragonSolrDocument do subject { SolrDocument.new(fields).to_openseadragon(view_config) } context 'when configured for the view' do let(:fields) { { some_field: 'data' } } let(:view_config) { double('ViewConfig', tile_source_field: :some_field) } it 'returns the data from the document as an array' do expect(subject).to eq ['data'] end end context 'when not configured for the view' do let(:fields) { { some_field: 'data' } } let(:view_config) { double('ViewConfig') } it 'returns nil' do expect(subject).to be_nil end end context 'when the document has the field' do let(:fields) { { some_field: 'data' } } let(:view_config) { double('ViewConfig', tile_source_field: :some_field) } it 'returns the data from the document as an array' do expect(subject).to eq ['data'] end end context 'when the document does not have the field' do let(:fields) { { some_other_field: 'data' } } let(:view_config) { double('ViewConfig', tile_source_field: :some_field) } it 'returns the data from the document as an array' do expect(subject).to be_nil end end end
Version data entries
24 entries across 24 versions & 1 rubygems