Write tests for RQuery