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: jobs_spec.rb
    path of file: ./repos/gitlabhq/spec/requests/api/graphql/ci
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require 'spec_helper'

RSpec.describe 'Query.jobs', feature_category: :continuous_integration do
  include GraphqlHelpers

  let_it_be(:admin) { create(:admin) }
  let_it_be(:project) { create(:project, :repository, :p
    
  def graphql_data_previous_stage_jobs
    stages = graphql_data.dig('project', 'pipeline', 'stages', 'nodes')
    groups = stages.flat_map { |stage| stage.dig('groups', 'nodes') }
    jobs = groups.flat_map { |group| group.dig('jobs', 'nodes') }

    jobs.each_with_object({}) do |job, previous_stage_jobs|
      previous_stage_jobs[job['name']] = job.dig('previousStageJobs', 'nodes').pluck('name')
    end
  end