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: system_helpers.rb
    path of file: ./repos/convene/spec/support
    
    the code of the file until where you have to start completion: module Spec
  module SystemHelpers
    def sign_in(user, space)
      visit(polymorphic_path(space.loca
    
    def sign_in(user, space)
      visit(polymorphic_path(space.location))
      click_link("Sign in")
      fill_in("authenticated_session[contact_location]", with: user.email)
      find('input[type="submit"]').click
      perform_enqueued_jobs
      delivery = ActionMailer::Base.deliveries.first
      return sign_in(user, space) unless delivery
      visit(URI.parse(URI.extract(delivery.body.to_s)[1]).request_uri)
    end