Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 23 lines (19 sloc) 0.711 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
require File.dirname(__FILE__) + '/test_helper.rb'

class ConfigTest < ActiveSupport::TestCase
  def test_per_page
    Searchlogic::Config.search.per_page = 1
    
    assert Account.count > 1
    assert Account.all.size > 1
    assert User.all.size > 1
    assert User.find(:all, :per_page => 1).size == 1
    assert User.new_search.all.size == 1
    assert User.new_search(:per_page => nil).all.size > 1
    
    Searchlogic::Config.search.per_page = nil
    
    assert Account.count > 1
    assert Account.all.size > 1
    assert User.all.size > 1
    assert User.find(:all, :per_page => 1).size == 1
    assert User.new_search.all.size > 1
    assert User.new_search(:per_page => 1).all.size == 1
  end
end
Something went wrong with that request. Please try again.