<commit_before>require 'test_helper'

class CarTest < ActiveSupport::TestCase
  test "at least one field is filled" do
    refute Car.new().valid?
    assert Car.new({description: 'A shitty van hit me'}).valid?
    assert cars(:volvo).valid?
    assert cars(:bmw).valid?
  end

  test "license plate always in uppercase" do
    cars = []
    cars.push Car.new({license_plate: "a1a1 a1a1"})
    cars.push Car.new({license_plate: "A1A1 A1A1"})

    cars.each do |c|
      assert_equal "A1A1 A1A1", c.license_plate
    end
  end
end<commit_msg>Update validation test with assoc. constraint<commit_after>require 'test_helper'

class CarTest < ActiveSupport::TestCase
  test "at least one field is filled" do
    refute Car.new().valid?
    assert Car.new({description: 'A shitty van hit me', incident: incidents(:one)}).valid?
  end

  test "license plate always in uppercase" do
    cars = []
    cars.push Car.new({license_plate: "a1a1 a1a1"})
    cars.push Car.new({license_plate: "A1A1 A1A1"})

    cars.each do |c|
      assert_equal "A1A1 A1A1", c.license_plate
    end
  end
end
{'fraction_non_alphanumeric': 0.11655874190564293, 'fraction_numerical': 0.022201665124884366, 'mean_word_length': 3.6042553191489364, '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': '3184705', 'n_tokens_mistral': 384, 'n_tokens_neox': 371, 'n_words': 108}