Read about factory_girl here: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md And take a look here: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#associations

Ergo, just write

    factory :vote do
      weight 1
      game
      user
    end

And FactoryGirl will create the relations by itself.