Add tests for query with conditions [closes #4]