Yep (Factories are managed with FactoryGirl): note the difference between build (= build a new instance of TeamInvite, but don't save it yet) and create (= build and save). Here: We build a TeamInvite and, before being able to save it, we have to assign it to a player and a team, so we create them as well (otherwise, the built TeamInvite is not valid)