<commit_before>module BenchmarkingContactDvlaABTestable
  def should_show_benchmarking_variant?
  # Use GOVUK-ABTest-BenchmarkDVLATitle1=B header in dev to test this
    benchmark_contact_dvla_title_variant.variant_b? &&
      is_benchmarking_tested_path?
  end

  def should_show_benchmarking_lab_variant?
  # Use GOVUK-ABTest-BenchmarkDVLAButton1=B header in dev to test this
    benchmark_contact_dvla_button_variant.variant_b? &&
      is_benchmarking_lab_tested_path?
  end

  def is_benchmarking_tested_path?
    request.path.starts_with?("/contact-the-dvla")
  end

  def is_benchmarking_lab_tested_path?
    request.path == "/contact-the-dvla"
  end

  def benchmark_contact_dvla_title_variant
    @benchmark_contact_dvla_title_variant ||= benchmarking_ab_test_title.requested_variant request.headers
  end

  def set_benchmark_contact_dvla_title_response_header
    benchmark_contact_dvla_title_variant.configure_response response
  end

  def benchmark_contact_dvla_button_variant
    @benchmark_contact_dvla_button_variant ||= benchmarking_ab_test_button.requested_variant request.headers
  end

  def set_benchmark_contact_dvla_button_response_header
    benchmark_contact_dvla_button_variant.configure_response response
  end

  def self.included(base)
    base.helper_method :benchmark_contact_dvla_title_variant, :benchmark_contact_dvla_button_variant
  end

private

  def benchmarking_ab_test_title
    @ab_test ||= GovukAbTesting::AbTest.new("BenchmarkDVLATitle1", dimension: 48)
  end

  def benchmarking_ab_test_button
    @ab_test ||= GovukAbTesting::AbTest.new("BenchmarkDVLAButton1", dimension: 62)
  end
end<commit_msg>Name the @ab_test variable differently per test<commit_after>module BenchmarkingContactDvlaABTestable
  def should_show_benchmarking_variant?
  # Use GOVUK-ABTest-BenchmarkDVLATitle1=B header in dev to test this
    benchmark_contact_dvla_title_variant.variant_b? &&
      is_benchmarking_tested_path?
  end

  def should_show_benchmarking_lab_variant?
  # Use GOVUK-ABTest-BenchmarkDVLAButton1=B header in dev to test this
    benchmark_contact_dvla_button_variant.variant_b? &&
      is_benchmarking_lab_tested_path?
  end

  def is_benchmarking_tested_path?
    request.path.starts_with?("/contact-the-dvla")
  end

  def is_benchmarking_lab_tested_path?
    request.path == "/contact-the-dvla"
  end

  def benchmark_contact_dvla_title_variant
    @benchmark_contact_dvla_title_variant ||= benchmarking_ab_test_title.requested_variant request.headers
  end

  def set_benchmark_contact_dvla_title_response_header
    benchmark_contact_dvla_title_variant.configure_response response
  end

  def benchmark_contact_dvla_button_variant
    @benchmark_contact_dvla_button_variant ||= benchmarking_ab_test_button.requested_variant request.headers
  end

  def set_benchmark_contact_dvla_button_response_header
    benchmark_contact_dvla_button_variant.configure_response response
  end

  def self.included(base)
    base.helper_method :benchmark_contact_dvla_title_variant, :benchmark_contact_dvla_button_variant
  end

private

  def benchmarking_ab_test_title
    @ab_test_title ||= GovukAbTesting::AbTest.new("BenchmarkDVLATitle1", dimension: 48)
  end

  def benchmarking_ab_test_button
    @ab_test_button ||= GovukAbTesting::AbTest.new("BenchmarkDVLAButton1", dimension: 62)
  end
end
{'fraction_non_alphanumeric': 0.054305430543054305, 'fraction_numerical': 0.004800480048004801, 'mean_word_length': 6.16989247311828, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4823457', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1111, 'n_words': 167}