Testing Gotchas

  • ElasticSearch has a 1+ second refresh period. The consequence of this is that when you are using it, especially in tests, it will give you wrong counts. The best thing to do is Event.refresh_index!and this will refresh the index and give accurate counts.

  • before(:all) blocks are not cleared in a transaction, so you must do an after(:all) to clear them manually.

Last updated