You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: recipient_counts_controller_spec.rb
    path of file: ./repos/hitobito/spec/controllers/mailing_lists
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

#  Copyright (c) 2021, Die Mitte Schweiz. This file is part of
#  hitobito and licensed under the Affero General Public License version 3
#  or 
    
  def fabricate_valid_households(num = 1)
    num.times do
      household_key = Person::Household.new(nil, nil, nil, nil).send(:next_key)

      # between 2 and 6 housemates
      housemates = fabricate_recipients(:subscription_with_subscriber_with_address, 2 + rand(4))
      housemates.each {|housemate| housemate.update_attribute(:household_key, household_key) }
    end
  end