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

require 'spec_helper'

RSpec.describe Gitlab::X509::Certificate, feature_category: :source_code_management do
  include SmimeHelper

  let(:sample_ca_certs_path) { Rails.root.join('spec/fixtures/clusters').to_s }
  let(:sample_cert) { Rails.root.join('spec/fixtures/x509_certificate.crt').to_s }

  # cert gene
    
  def common_cert_tests(parsed_cert, cert, signer_ca, with_ca_certs: nil)
    expect(parsed_cert.cert).to be_a(OpenSSL::X509::Certificate)
    expect(parsed_cert.cert.subject).to eq(cert[:cert].subject)
    expect(parsed_cert.cert.issuer).to eq(signer_ca[:cert].subject)
    expect(parsed_cert.cert.not_before).to eq(cert[:cert].not_before)
    expect(parsed_cert.cert.not_after).to eq(cert[:cert].not_after)
    expect(parsed_cert.cert.extensions).to include(an_object_having_attributes(oid: 'extendedKeyUsage', value: match('E-mail Protection')))
    expect(parsed_cert.key).to be_a(OpenSSL::PKey::RSA)
    expect(parsed_cert.ca_certs).to match_array(Array.wrap(with_ca_certs)) if with_ca_certs
  end