<commit_before>require 'test_helper'

class RoomTest < ActiveSupport::TestCase
  test "cannot create duplicate rooms with same shortcode" do
    rm1 = Room.new do |r|
      r.name        = "Paddington"
      r.description = "The big room upstairs."
      r.short_code  = "pad"
    end

    rm1.save
    assert rm1.errors.empty?

    rm2 = Room.new do |r|
      r.name        = "<NAME>"
      r.description = "A completely different room."
      r.short_code  = "pad"
    end
    
    rm2.save
    assert rm2.errors.include?(:short_code)
  end
  
  test "short codes must be of the right format" do
    rm = Room.new(:name => "Charing Cross", :short_code => "Charing Cross")
    rm.save
    assert rm.errors.include?(:short_code)
<commit_msg>Fixed rooms test as we are now using pad elsewhere<commit_after>require 'test_helper'

class RoomTest < ActiveSupport::TestCase
  test "cannot create duplicate rooms with same shortcode" do
    rm1 = Room.new do |r|
      r.name        = "Paddington"
      r.description = "The big room upstairs."
      r.short_code  = "pai"
    end

    rm1.save
    assert rm1.errors.empty?

    rm2 = Room.new do |r|
      r.name        = "<NAME>"
      r.description = "A completely different room."
      r.short_code  = "pai"
    end

    rm2.save
    assert rm2.errors.include?(:short_code)
  end

  test "short codes must be of the right format" do
    rm = Room.new(:name => "Charing Cross", :short_code => "Charing Cross")
    rm.save
    assert rm.errors.include?(:short_code)

{'fraction_non_alphanumeric': 0.10707204230006609, 'fraction_numerical': 0.007931262392597489, 'mean_word_length': 2.5046296296296298, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '3478122', 'n_tokens_mistral': 496, 'n_tokens_neox': 487, 'n_words': 149}