<commit_before>require 'test_helper'

class PersonTest < ActiveSupport::TestCase
  should_protect_against_xss_and_content_attacks_on :biography

  test "should be invalid without a name" do
    person = build(:person, title: nil, forename: nil, surname: nil, letters: nil)
    refute person.valid?
  end

  test "should be invalid if image isn't 960x640px" do
    person = build(:person, image: File.open('test/fixtures/horrible-image.64x96.jpg'))
    refute person.valid?
  end

  test "should be valid if legacy image isn't 960x640px" do
    person = build(:person, image: File.open('test/fixtures/horrible-image.64x96.jpg'))
    person.save(validate: false)
    assert person.reload.valid?
  end<commit_msg>Use absolute paths in the person unit test<commit_after>require 'test_helper'

class PersonTest < ActiveSupport::TestCase
  should_protect_against_xss_and_content_attacks_on :biography

  test "should be invalid without a name" do
    person = build(:person, title: nil, forename: nil, surname: nil, letters: nil)
    refute person.valid?
  end

  test "should be invalid if image isn't 960x640px" do
    person = build(:person, image: File.open(Rails.root.join('test/fixtures/horrible-image.64x96.jpg')))
    refute person.valid?
  end

  test "should be valid if legacy image isn't 960x640px" do
    person = build(:person, image: File.open(Rails.root.join('test/fixtures/horrible-image.64x96.jpg')))
    person.save(validate: false)
    assert person.reload.valid?
  end
{'fraction_non_alphanumeric': 0.10249494268374916, 'fraction_numerical': 0.026972353337828724, 'mean_word_length': 4.496296296296296, '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': '7286901', 'n_tokens_mistral': 512, 'n_tokens_neox': 471, 'n_words': 132}