<commit_before>require "test_helper"

class InvitationsMailerTest < ActionMailer::TestCase
  test "catalog_admin" do
    user = users(:two_admin)
    mail = InvitationsMailer.admin(user, "__test_token__")

    assert_match(/invitation for two/i, mail.subject)
    assert_equal(["<EMAIL>"], mail.from)
    assert_equal(["<EMAIL>"], mail.reply_to)
    assert_equal(["<EMAIL>"], mail.to)
    assert_match(/administrator of the two catalog/i, mail.body.encoded.squish)
    assert_match("reset_password_token=__test_token__", mail.body.encoded)
  end

  test "system_admin" do
    user = users(:system_admin_invited_by_one)
    mail = InvitationsMailer.admin(user, "__test_token__")

    assert_match(/system administrator invitation/i, mail.subject)
    assert_equal(["<EMAIL>"], mail.from)
    assert_equal(["<EMAIL>"], mail.reply_to)
    assert_equal(["<EMAIL>"], mail.to)
    assert_match(/invited you to be a system administrator/, mail.body.encoded)
    assert_match("reset_password_token=__test_token__", mail.body.encoded)
  end
end<commit_msg>Adjusted tests for new catima settings<commit_after>require "test_helper"

class InvitationsMailerTest < ActionMailer::TestCase
  test "catalog_admin" do
    user = users(:two_admin)
    mail = InvitationsMailer.admin(user, "__test_token__")

    assert_match(/invitation for two/i, mail.subject)
    assert_equal(["<EMAIL>"], mail.from)
    assert_equal(["<EMAIL>"], mail.reply_to)
    assert_equal(["<EMAIL>"], mail.to)
    assert_match(/administrator of the two catalog/i, mail.body.encoded.squish)
    assert_match("reset_password_token=__test_token__", mail.body.encoded)
  end

  test "system_admin" do
    user = users(:system_admin_invited_by_one)
    mail = InvitationsMailer.admin(user, "__test_token__")

    assert_match(/system administrator invitation/i, mail.subject)
    assert_equal(["<EMAIL>"], mail.from)
    assert_equal(["<EMAIL>"], mail.reply_to)
    assert_equal(["<EMAIL>"], mail.to)
    assert_match(/invited you to be a system administrator/, mail.body.encoded)
    assert_match("reset_password_token=__test_token__", mail.body.encoded)
  end
end
{'fraction_non_alphanumeric': 0.12930627654554036, 'fraction_numerical': 0.0, 'mean_word_length': 5.162790697674419, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '2751930', 'n_tokens_mistral': 710, 'n_tokens_neox': 701, 'n_words': 128}