<commit_before>require File.dirname(__FILE__) + '/../test_helper'

class CompanyTest < ActiveSupport::TestCase
  test "create company" do
    company = Company.create(:name => "<NAME>.")
    assert company.valid?
    assert !company.new_record?
  end

  test "try to create company without name" do
    company = Company.create(:name => nil)
    assert_equal "Name can't be blank", company.errors.full_messages.join(", ")
  end

  test "try to repeat company name" do
    company = Company.create(:name => "<NAME>.")
    assert company.valid?
    assert !company.new_record?
    company = Company.create(:name => "<NAME>.")
    assert_equal "Name has already been taken", company.errors.full_messages.join(", ")
  end
end<commit_msg>Company model tests now use helper method<commit_after>require File.dirname(__FILE__) + '/../test_helper'

class CompanyTest < ActiveSupport::TestCase
  test "create company" do
    company = Company.create(default_hash(Company))
    assert company.valid?
    assert !company.new_record?
  end

  test "try to create company without name" do
    company = Company.create(:name => nil)
    assert_equal "Name can't be blank", company.errors.full_messages.join(", ")
  end

  test "try to repeat company name" do
    company = Company.create(default_hash(Company))
    assert company.valid?
    assert !company.new_record?
    company = Company.create(default_hash(Company))
    assert_equal "Name has already been taken", company.errors.full_messages.join(", ")
  end
end
{'fraction_non_alphanumeric': 0.11842980705256155, 'fraction_numerical': 0.0, 'mean_word_length': 4.046979865771812, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 11, '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': '4594266', 'n_tokens_mistral': 429, 'n_tokens_neox': 426, 'n_words': 126}