Fix for RSpec

Compatibility with RSpec 3
Add helper for synchronous queries