Add test case for scoped queries.