Topic: acts_as_ferret enjoyment

When doing this:

criterion = {:name => params[:resource_name] }
Resource.search(criterion)

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)
  end

The test fails.

Doing the following in "$ script/console test"

Resource.search({:name => "*"}).size

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

Resource.count

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

Ideas?

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 => "*").