add tests on Query using joins.