sunspot/sunspot — pull request #257 by tommeier (2012-07-03 12:26:51+00:00)
Title: [Fix] Failure with StubSessionProxy on Object.search_ids with use of raw_results

Method 'raw_results' is now an alias of 'hits'
https://github.com/sunspot/sunspot/blob/master/sunspot/lib/sunspot/search/abstract_search.rb#L93

But the core searchable uses it when firing Object.search_ids requests :

https://github.com/sunspot/sunspot/blob/master/sunspot_rails/lib/sunspot/rails/searchable.rb#L345

This causes a fail when using StubSessionProxy as it doesn't have a mock for raw_results on the returned object.

We could either add raw_results to StubSessionProxy, or IMHO the better fix is to use the correct (unaliased) method.

I had some trouble getting the sunspot_rails spec suite to run, so I haven't been able to write a test. But its pretty straight forward as there is no 'Post.search_ids' check, which explodes without this fix.