<commit_before># -*- encoding : utf-8 -*-
FactoryGirl.define do

  factory :info_request do
    sequence(:title) { |n| "Example Title #{n}" }
    public_body
    user

    after(:create) do |info_request, evaluator|
      create(:initial_request, :info_request => info_request)
    end

    factory :info_request_with_incoming do
      after(:create) do |info_request, evaluator|
        incoming_message = create(:incoming_message, :info_request => info_request)
        info_request.log_event("response", {:incoming_message_id => incoming_message.id})
      end
    end

    factory :info_request_with_plain_incoming do
      after(:create) do |info_request, evaluator|
        incoming_message = create(:plain_incoming_message, :info_request => info_request)
        info_request.log_event("response", {:incoming_message_id => incoming_message.id})
      end
    end

    factory :info_request_with_incoming_attachments do
      after(:create) do |info_request, evaluator|
        incoming_message = create(:incoming_message_with_attachments, :info_request => info_request)
        info_request.log_event("response", {:incoming_message_id => incoming_message.id})
      end
    end

    factory :info_request_with_internal_review_request do
      after(:create) do |info_request, evaluator|
        outgoing_message = create(:internal_review_request, :info_request => info_request)
      end
    end

    factory :external_request do
      user nil
      external_user_name 'External User'
      external_url 'http://www.example.org/request/external'
    end

  end<commit_msg>Add factory for old unclassified requests.<commit_after># -*- encoding : utf-8 -*-
FactoryGirl.define do

  factory :info_request do
    sequence(:title) { |n| "Example Title #{n}" }
    public_body
    user

    after(:create) do |info_request, evaluator|
      create(:initial_request, :info_request => info_request)
    end

    factory :info_request_with_incoming do
      after(:create) do |info_request, evaluator|
        incoming_message = create(:incoming_message, :info_request => info_request)
        info_request.log_event("response", {:incoming_message_id => incoming_message.id})
      end
    end

    factory :info_request_with_plain_incoming do
      after(:create) do |info_request, evaluator|
        incoming_message = create(:plain_incoming_message, :info_request => info_request)
        info_request.log_event("response", {:incoming_message_id => incoming_message.id})
      end
    end

    factory :info_request_with_incoming_attachments do
      after(:create) do |info_request, evaluator|
        incoming_message = create(:incoming_message_with_attachments, :info_request => info_request)
        info_request.log_event("response", {:incoming_message_id => incoming_message.id})
      end
    end

    factory :info_request_with_internal_review_request do
      after(:create) do |info_request, evaluator|
        outgoing_message = create(:internal_review_request, :info_request => info_request)
      end
    end

    factory :external_request do
      user nil
      external_user_name 'External User'
      external_url 'http://www.example.org/request/external'
    end

    factory :old_unclassified_request do
      after(:create) do |info_request, evaluator|
        incoming_message = FactoryGirl.create(:incoming_message, :info_request => info_request)
        info_request.log_event("response", {:incoming_message_id => incoming_message.id})
        info_request.last_public_response_at = Time.now - 31.days
        info_request.awaiting_description = true
        info_request.save!
      end
    end
  end
{'fraction_non_alphanumeric': 0.09156094870380585, 'fraction_numerical': 0.0011031439602868175, 'mean_word_length': 3.7473821989528795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6415432', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1050, 'n_words': 218}