fixed has_one_and_has_many_test test and added test for when association is nil