Add a test case for hasAndBelongsToMany