<commit_before>require "govuk_content_models/test_helpers/factories"

FactoryGirl.define do
  factory :editor, parent: :user do
    permissions %w(signin editor)
  end

  factory :cma_writer, parent: :user do
    organisation_slug "competition-and-markets-authority"
  end

  factory :cma_editor, parent: :editor do
    organisation_slug "competition-and-markets-authority"
  end

  factory :dclg_editor, parent: :editor do
    organisation_slug "department-for-communities-and-local-government"
  end

  factory :generic_writer, parent: :user do
    organisation_slug "ministry-of-tea"
  end

  factory :generic_editor, parent: :editor do
    organisation_slug "ministry-of-tea"
  end

  factory :gds_editor, parent: :user do
    permissions %w(signin gds_editor)
    organisation_slug "government-digital-service"
  end

  factory :specialist_document_edition do
    document_id { BSON::ObjectId.new }
    sequence(:slug) {|n| "test-specialist-document-#{n}" }
    sequence(:title) {|n| "Test Specialist Document #{n}" }
    summary "My summary"
    body "My body"
    document_type "cma_case"
    extra_fields do
      {
        opened_date: "2013-04-20",
        market_sector: "some-market-sector",
        case_type: "a-case-type",
        case_state: "open",
      }<commit_msg>Specialist document editions factories return "manual"s<commit_after>require "govuk_content_models/test_helpers/factories"

FactoryGirl.define do
  factory :editor, parent: :user do
    permissions %w(signin editor)
  end

  factory :cma_writer, parent: :user do
    organisation_slug "competition-and-markets-authority"
  end

  factory :cma_editor, parent: :editor do
    organisation_slug "competition-and-markets-authority"
  end

  factory :dclg_editor, parent: :editor do
    organisation_slug "department-for-communities-and-local-government"
  end

  factory :generic_writer, parent: :user do
    organisation_slug "ministry-of-tea"
  end

  factory :generic_editor, parent: :editor do
    organisation_slug "ministry-of-tea"
  end

  factory :gds_editor, parent: :user do
    permissions %w(signin gds_editor)
    organisation_slug "government-digital-service"
  end

  factory :specialist_document_edition do
    document_id { BSON::ObjectId.new }
    sequence(:slug) {|n| "test-specialist-document-#{n}" }
    sequence(:title) {|n| "Test Specialist Document #{n}" }
    summary "My summary"
    body "My body"
    document_type "manual"
    extra_fields do
      {
        opened_date: "2013-04-20",
        market_sector: "some-market-sector",
        case_type: "a-case-type",
        case_state: "open",
      }
{'fraction_non_alphanumeric': 0.10344827586206896, 'fraction_numerical': 0.006130268199233717, 'mean_word_length': 3.7300724637681157, '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': '4778500', 'n_tokens_mistral': 879, 'n_tokens_neox': 865, 'n_words': 197}