Sha256: 23abefef050ebfe89c750c5cf75b6bed2f7054cf974d93a3d58097614556e82e

Contents?: true

Size: 936 Bytes

Versions: 7

Compression:

Stored size: 936 Bytes

Contents

require 'test_unit_test_case'
require File.join(File.dirname(__FILE__), '..', 'lib', 'rsolr-ext')
require 'helper'

class RSolrExtResponseTest < Test::Unit::TestCase
  
  test 'base response class' do
    raw_response = eval(mock_query_response)
    r = RSolr::Ext::Response::Base.new(raw_response)
    assert r.ok?
  end
  
  test 'standard response class' do
    raw_response = eval(mock_query_response)
    r = RSolr::Ext::Response::Standard.new(raw_response)
    assert r.ok?
    assert_equal 10, r.response.docs.size
    assert_equal 'EXPLICIT', r.response_header.params.echo_params
    assert_equal r['responseHeader'], r.response_header
    assert_equal r[:responseHeader], r.response_header
    assert_equal 1, r.response.docs.previous_page
    assert_equal 1, r.response.docs.next_page
    #
    assert r.response.docs.kind_of?(RSolr::Ext::Response::Pageable)
    assert r.kind_of?(RSolr::Ext::Response::Facetable)
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mwmitchell-rsolr-ext-0.5.0 test/response_test.rb
mwmitchell-rsolr-ext-0.5.1 test/response_test.rb
mwmitchell-rsolr-ext-0.5.2 test/response_test.rb
mwmitchell-rsolr-ext-0.5.3 test/response_test.rb
mwmitchell-rsolr-ext-0.5.4 test/response_test.rb
mwmitchell-rsolr-ext-0.5.5 test/response_test.rb
mwmitchell-rsolr-ext-0.5.6 test/response_test.rb