added tests for factories and associations