Sha256: c3f51ffd423230b89d185917a13ba769f008bfecfd4bd86904957950c134304b

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

require 'spec_helper'

describe Geoblacklight::SolrDocument::Finder do
  let(:subject) { Geoblacklight::SolrDocument }
  describe '#find' do
    it 'calls index and returns first document' do
      documents = %w(first second)
      response = double('response')
      index = double('index')
      expect(response).to receive(:documents).and_return(documents)
      expect(index).to receive(:find).with('search param').and_return(response)
      expect(subject).to receive(:index).and_return(index)
      expect(subject.find('search param')).to eq 'first'
    end
  end
  describe '#index' do
    it 'creates and returns a Blacklight::SolrRepository' do
      expect(subject.index).to be_an Blacklight::SolrRepository
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
geoblacklight-0.11.1 spec/lib/geoblacklight/solr_document/finder_spec.rb
geoblacklight-0.11.0 spec/lib/geoblacklight/solr_document/finder_spec.rb
geoblacklight-0.10.2 spec/lib/geoblacklight/solr_document/finder_spec.rb
geoblacklight-0.10.1 spec/lib/geoblacklight/solr_document/finder_spec.rb
geoblacklight-0.10.0 spec/lib/geoblacklight/solr_document/finder_spec.rb