Sha256: a92f3144759dba3f39e6bebcecb10b33c23c0e083232b6cb9824d79aff980ef9
Contents?: true
Size: 970 Bytes
Versions: 22
Compression:
Stored size: 970 Bytes
Contents
# frozen_string_literal: true describe Blacklight::SuggestSearch do let(:params) { {q: 'test'} } let(:suggest_path) { 'suggest' } let(:connection) { instance_double(RSolr::Client, send_and_receive: 'sent')} let(:repository) { instance_double(Blacklight::Solr::Repository, connection: connection) } let(:suggest_search) { described_class.new(params, repository)} describe '#suggestions' do it 'returns a Blacklight::Suggest::Response' do expect(suggest_search).to receive(:suggest_results).and_return([]) expect(suggest_search).to receive(:suggest_handler_path).and_return(suggest_path) expect(suggest_search.suggestions).to be_an Blacklight::Suggest::Response end end describe '#suggest_results' do it 'calls send_and_recieve from a repository connection' do expect(suggest_search).to receive(:suggest_handler_path).and_return(suggest_path) expect(suggest_search.suggest_results).to eq 'sent' end end end
Version data entries
22 entries across 22 versions & 1 rubygems