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: user_registration_service_spec.rb
    path of file: ./repos/coursemology2/spec/services/course
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require 'rails_help
    
    def self.registration_with_registration_code
      let(:registration) do
        course.generate_registration_key
        course.save!
        Course::Registration.new(course: course, user: user, code: course.registration_key.dup)
      end
    end