Test case for multple joins