Add tests for Factory.attributes()