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: idoit_spec.rb
    path of file: ./repos/zammad/spec/system/ticket
    
    the code of the file until where you have to start completion: # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/

require 'rails_helper'

RSpec.describe 'Ticket Handling with i-doit', integration: true, required_envs: %w[IDOIT_API_TOKEN IDOIT_API_ENDPOINT IDOIT_API_CATEGORY], type: :system do

  let(:api_endpoint) { ENV['IDOIT_API_ENDPOINT'] }
  let(:api_category) { ENV['IDOIT_API_CATEGORY'] }

  before do
    Setting.set('idoit_integration', true)
    Setting.s
    
  def select_entry_in_sidebar
    find('.sidebar[data-tab="idoit"] .js-headline').click
    find('.sidebar[data-tab="idoit"] .dropdown-menu').click
    entry_id = nil

    in_modal do
      find('form input.js-input').click
      find("form li.js-option[data-display-name='#{api_category}']").click
      entry_id = find('form.js-result tbody tr:first-child input').tap(&:click).value
      # submit the i-doit object selections
      find('form button.js-submit').click
    end

    entry_id
  end