<commit_before>class RequestTestCase < Test::Unit::TestCase

  include Rack::Test::Methods
  include ModelHelpers
  include VariousHelpers
  include RequestHelpers

  before :all do
    Category.destroy_all
    Comment.destroy_all
    Document.destroy_all
    Note.destroy_all
    Organization.destroy_all
    Rating.destroy_all
    Source.destroy_all
    Tag.destroy_all
    User.destroy_all
    @normal_user = create_normal_user
    @curator_user = create_curator_user
    @admin_user = create_admin_user
  end

  def primary_api_key_for(role)<commit_msg>Refactor before :all in request_test_case.rb<commit_after>class RequestTestCase < Test::Unit::TestCase

  include Rack::Test::Methods
  include ModelHelpers
  include VariousHelpers
  include RequestHelpers

  before :all do
    [
      Categorization,
      Category,
      Comment,
      Document,
      Note,
      Organization,
      Rating,
      Source,
      Tag,
      User,
    ].each { |m| m.destroy_all }
    @normal_user = create_normal_user
    @curator_user = create_curator_user
    @admin_user = create_admin_user
  end

  def primary_api_key_for(role)
{'fraction_non_alphanumeric': 0.06311111111111112, 'fraction_numerical': 0.0, 'mean_word_length': 3.3984375, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2225765', 'n_tokens_mistral': 345, 'n_tokens_neox': 344, 'n_words': 71}