Sha256: a70773c394fe64df91946cfb5fb977701d66105df451b6a671c21be2e03190d0

Contents?: true

Size: 759 Bytes

Versions: 11

Compression:

Stored size: 759 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

class TestConfig < Test::Unit::TestCase
  def test_per_page
    Searchgasm::Config.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
    
    Searchgasm::Config.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
  
  # test that config options do not mess up regular AR searches
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
searchgasm-1.3.3 test/test_config.rb
searchgasm-1.2.0 test/test_config.rb
searchgasm-1.2.1 test/test_config.rb
searchgasm-1.3.1 test/test_config.rb
searchgasm-1.2.2 test/test_config.rb
searchgasm-1.3.0 test/test_config.rb
searchgasm-1.3.2 test/test_config.rb
searchgasm-1.3.4 test/test_config.rb
searchgasm-1.4.0 test/test_config.rb
searchgasm-1.4.1 test/test_config.rb
searchgasm-1.3.5 test/test_config.rb