<commit_before>require 'test_helper'

module Iconly
  class UserTest < ActiveSupport::TestCase
    test 'associations' do
      assert_equal %i(packages projects), User.reflect_on_all_associations.map(&:name)
    end

    test 'validations' do
      user = User.new

      assert_not user.valid?
      assert_equal ["Uid can't be blank", "Name can't be blank", "Email can't be blank"], user.errors.full_messages
    end
  end
end<commit_msg>generate new project on user creation<commit_after>require 'test_helper'

module Iconly
  class UserTest < ActiveSupport::TestCase
    test 'associations' do
      assert_equal %i(packages projects), User.reflect_on_all_associations.map(&:name)
    end

    test 'validations' do
      user = User.new

      assert_not user.valid?
      assert_equal ["Uid can't be blank", "Name can't be blank", "Email can't be blank"], user.errors.full_messages
    end

    test 'should generate a project on create' do
      user = User.create(uid: '11', name: 'Paul', email: '<EMAIL>')

      assert_equal 1, user.projects.size
      assert_equal 'Untitled Project', user.projects.first.name

      user.destroy
    end
  end
end
{'fraction_non_alphanumeric': 0.09749784296807593, 'fraction_numerical': 0.0025884383088869713, 'mean_word_length': 3.4787644787644787, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, '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': '6696347', 'n_tokens_mistral': 362, 'n_tokens_neox': 346, 'n_words': 106}