I stub with test doubles in controller specs, returning an array if the controller is manipulating search results in some way. The array could be empty by default, but contain test double search result objects when spec'ing manipulation. Would also stub non-array methods (such as pagination) on the test double as well if necessary.
In acceptance tests (Cucumber or otherwise), I have Sphinx started and data indexed using the test helpers, so it's a full stack test. http://freelancing-god.github.com/ts/en/testing.html http://freelancing-gods.com/posts/using_thinking_sphinx_with_cucumber Cheers -- Pat On 03/12/2011, at 10:14 AM, Ngan wrote: > Just wondering what's best practice specing a rails app that uses ts? > Should I have sphinx running when I run my tests (kinda sucks)? Or > should I be stubbing (better IMO)? But if I stub what should I return? > Is there an easy way to mock up a ts search results object that has > all the helper methods on it , or even a real results object? > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en. > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
