Test Thinking Sphinx search results in Rails Minitest

155 views Asked by At

Should someone cover sphinx search results tests in there tests suits?

What I was thinking: "Thinking Sphinx is a gem that is widely used and tested by many users and contributors. So Why should we retest it in our applications."

1

There are 1 answers

2
Novae On BEST ANSWER

I think it's always good to have a understanding of that the code(TS in this case) your depending looks like and is tested well. Convince yourself the tests inside the TS cover what you use and are will catch regressions.

Further then that I think you have the right mindset. More importantly, having Unit tests depend on 3rd party libraries or services is normally a bad idea as you would be (unintentionally) testing their system. To cover the integration with TS in your application you should write some integration/end-to-end tests that stress the entire infrastructure. The latter is normally slow and can be a bit cumbersome but do add great value. Furthermore it's important to have your unit tests and integration tests separated so you can only run the integration tests prior to a deployment or have it run on in CI.

HTH,