Sha256: 872b20d02b3fd62883cee3cb6ac534446f21216b9cf79dd9171726ff5244c11a

Contents?: true

Size: 677 Bytes

Versions: 2

Compression:

Stored size: 677 Bytes

Contents

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

class RSolrExtRequestTest < Test::Unit::TestCase
  
  test 'standard request' do
    std = RSolr::Ext::Request::Standard.new
    solr_params = std.map(
      :page=>2,
      :per_page=>10,
      :phrases=>{:name=>'This is a phrase'},
      :filters=>['test', {:price=>(1..10)}],
      :phrase_filters=>{:manu=>['Apple']},
      :q=>'ipod'
    )
    assert_equal "test price:[1 TO 10] manu:\"Apple\"", solr_params[:fq]
    assert_equal 10, solr_params[:start]
    assert_equal 10, solr_params[:rows]
    assert_equal "ipod name:\"This is a phrase\"", solr_params[:q]
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mwmitchell-rsolr-ext-0.4.1 test/request_test.rb
mwmitchell-rsolr-ext-0.5.0 test/request_test.rb