add factory_girl, refactor tests