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_uses_header_search_field_spec.rb
    path of file: ./repos/gitlabhq/spec/features/search
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'User uses header search field', :js, :disable_rate_limiter, feature_category: :global_search do
  include FilteredSearchHelpers

  let_it_be(:project) { create(:project, :repository) }
  let_it_be(:reporter) { create(:user) }
  let_it_be(:developer) { create(:user) }

  let(:user) { reporter }

  before_all do
    project.add_reporter(reporter)
    project.add_developer(deve
    
  def scoped_search_link(term, project_id: nil, group_id: nil, search_code: nil, repository_ref: nil)
    # search_path will accept group_id and project_id but the order does not match
    # what is expected in the href, so the variable must be built manually
    href = search_path(search: term)
    href.concat("&nav_source=navbar")
    href.concat("&project_id=#{project_id}") if project_id
    href.concat("&group_id=#{group_id}") if group_id
    href.concat("&search_code=true") if search_code
    href.concat("&repository_ref=#{repository_ref}") if repository_ref

    ".global-search-results a[href='#{href}']"
  end

  def search_modal_results
    ".global-search-results"
  end
end