Since the same tests should be run both for include / regular getAssociation calls, and for n:m and 1:m I've moved them into a function that can be called for each variant, to make the code shorter and make sure that all tests are run for all cases