Topic: acts_as_ferret enjoyment

When doing this:

criterion = {:name => params[:resource_name] }

in a controller action and then testing it appropriately

it 'should get the resources based on search input' do
    post 'resources', {:resource_name => 'Hilton', :resource_type => {:id => 1}}
    assigns['resources'].should_not be_nil
    assigns['resources'].size.should eql(1)

The test fails.

Doing the following in "$ script/console test"{:name => "*"}).size

Provides me with the number "5", or sometimes the number "4". However, if I do this:


it will return 17, every time, all the time.


P.S. In the browser it works.

Last edited by Radar (2007-08-01 02:40:32)

Re: acts_as_ferret enjoyment

Alrighty, that was due to our coding problem.

It's also smart to note that acts_as_ferret will return only 10 results when you do, say, Resource.find_by_contents(:name => "*").