Permalink
Browse files

fixed tests

  • Loading branch information...
dcrec1 committed Mar 20, 2011
1 parent 41899d0 commit a4125fecceff915111432380a5a7794bd6620e51
Showing with 2 additions and 3 deletions.
  1. +2 −2 lib/acts_as_solr/parser_methods.rb
  2. +0 −1 test/unit/test_helper.rb
@@ -15,7 +15,7 @@ def parse_query(query=nil, options={}, models=nil)
begin
Deprecation.validate_query(options)
per_page = options[:per_page] || options[:limit] || 30
- offset = options[:offset] || (((options[:page] || 1).to_i - 1) * per_page)
+ offset = options[:offset] || (((options[:page] || 1).to_i - 1) * per_page)
query_options[:rows] = per_page
query_options[:start] = offset
query_options[:operator] = options[:operator]
@@ -123,7 +123,7 @@ def parse_results(solr_data, options = {})
}
results.update(:spellcheck => solr_data.data['spellcheck']) unless solr_data.nil?
results.update(:facets => {'facet_fields' => []}) if options[:facets]
- unless solr_data.header['params'].nil?
+ unless solr_data.nil? or solr_data.header['params'].nil?
header = solr_data.header
results.update :rows => header['params']['rows']
results.update :start => header['params']['start']
View
@@ -4,7 +4,6 @@
require 'rubygems'
require 'test/unit'
require 'acts_as_solr'
-require 'activesupport'
require 'mocha'
require 'active_support'
require 'logger'

0 comments on commit a4125fe

Please sign in to comment.