<commit_before># encoding: utf-8
require 'test_helper'

class UserTest < ActiveSupport::TestCase
  test 'user' do
    tests = [
      {
        :name => '#1 - simple create',
        :create => {
          :firstname     => 'Firstname',
          :lastname      => 'Lastname',
          :email         => '<EMAIL>',
          :login         => '<EMAIL>',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :image     => 'none',
          :email     => '<EMAIL>',
          :login     => '<EMAIL>',
        },
      },
      {
        :name => '#2 - simple create - no lastname',
        :create => {
          :firstname     => 'Firstname Lastname',
          :lastname      => '',
          :email         => '<EMAIL>',
          :login         => '<EMAIL>',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :image     => 'none',
          :email     => '<EMAIL>',
          :login     => '<EMAIL>',
        },
      },
      {
        :name => '#3 - simple create - nil as lastname',
        :create => {
          :firstname     => 'Firstname Lastname',
          :lastname      => nil,
          :email         => '<EMAIL>',
          :login         => '<EMAIL>',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :image     => 'none',
          :email     => '<EMAIL>',
          :login     => '<EMAIL>',
        },
      },
      {
        :name => '#4 - simple create - no lastname, firstname with ","',
        :create => {
          :firstname     => 'Lastname, Firstname',
          :lastname      => '',
          :email         => '<EMAIL>',
          :login         => '<EMAIL>',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :email     => '<EMAIL>',
          :login     => '<EMAIL>',
        },
      },
      {
        :name => '#5 - simple create - no lastname/firstname',
        :create => {
          :firstname     => '',
          :lastname      => '',
          :email         => '<EMAIL>',
          :login         => 'login-1',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :email     => '<EMAIL>',
          :login     => 'login-1',
        },
      },
      {
        :name => '#6 - simple create - no lastname/firstnam',
        :create => {
          :firstname     => '',
          :lastname      => '',
          :email         => '<EMAIL>',
          :login         => 'login-2',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :email     => '<EMAIL>',
          :login     => 'login-2',
        },
      },
      {
        :name => '#7 - simple create - nill as fristname and lastname',
        :create => {
          :firstname     => nil,
          :lastname      => nil,
          :email         => '<EMAIL>',
          :login         => 'login-3',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :email     => '<EMAIL>',
          :login     => 'login-3',
        },
      },
      {
        :name => '#8 - update with avatar check',
        :create => {
          :firstname     => 'Bob',
          :lastname      => 'Smith',
          :email         => '<EMAIL>',
          :login         => 'login-4',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Bob',
          :lastname  => 'Smith',
          :image     => 'none',
          :image_md5 => '76fdc28c07e4f3d7802b75aacfccdf6a',
          :email     => '<EMAIL>',
          :login     => 'login-4',
        },
        :update => {
          :email => '<EMAIL>',
        },
        :update_verify => {
          :firstname => 'Bob',
          :lastname  => 'Smith',
          :image     => '9f19a507f4574b8455543408a7ef2257',
          :image_md5 => '9f19a507f4574b8455543408a7ef2257',
          :email     => '<EMAIL>',
          :login     => 'login-4',
        }
      },
      {
        :name => '#9 - update create with avatar check',
        :create => {
          :firstname     => 'Bob',
          :lastname      => 'Smith',
          :email         => '<EMAIL>',
          :login         => 'login-5',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Bob',
          :lastname  => 'Smith',
          :image     => 'fb83638ff260b20555b25173169135dd',
          :image_md5 => 'fb83638ff260b20555b25173169135dd',
          :email     => '<EMAIL>',
          :login     => 'login-5',
        },
        :update => {
          :email => '<EMAIL>',
        },
        :update_verify => {
          :firstname => 'Bob',
          :lastname  => 'Smith',
          :image     => '9f19a507f4574b8455543408a7ef2257',
          :image_md5 => '9f19a507f4574b8455543408a7ef2257',
          :email     => '<EMAIL>',
          :login     => 'login-5',
        }
      },
    ]

    tests.each { |test|
<commit_msg>Updated new image md5 sums.<commit_after># encoding: utf-8
require 'test_helper'

class UserTest < ActiveSupport::TestCase
  test 'user' do
    tests = [
      {
        :name => '#1 - simple create',
        :create => {
          :firstname     => 'Firstname',
          :lastname      => 'Lastname',
          :email         => '<EMAIL>',
          :login         => '<EMAIL>',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :image     => 'none',
          :email     => '<EMAIL>',
          :login     => '<EMAIL>',
        },
      },
      {
        :name => '#2 - simple create - no lastname',
        :create => {
          :firstname     => 'Firstname Lastname',
          :lastname      => '',
          :email         => '<EMAIL>',
          :login         => '<EMAIL>',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :image     => 'none',
          :email     => '<EMAIL>',
          :login     => '<EMAIL>',
        },
      },
      {
        :name => '#3 - simple create - nil as lastname',
        :create => {
          :firstname     => 'Firstname Lastname',
          :lastname      => nil,
          :email         => '<EMAIL>',
          :login         => '<EMAIL>',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :image     => 'none',
          :email     => '<EMAIL>',
          :login     => '<EMAIL>',
        },
      },
      {
        :name => '#4 - simple create - no lastname, firstname with ","',
        :create => {
          :firstname     => 'Lastname, Firstname',
          :lastname      => '',
          :email         => '<EMAIL>',
          :login         => '<EMAIL>',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :email     => '<EMAIL>',
          :login     => '<EMAIL>',
        },
      },
      {
        :name => '#5 - simple create - no lastname/firstname',
        :create => {
          :firstname     => '',
          :lastname      => '',
          :email         => '<EMAIL>',
          :login         => 'login-1',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :email     => '<EMAIL>',
          :login     => 'login-1',
        },
      },
      {
        :name => '#6 - simple create - no lastname/firstnam',
        :create => {
          :firstname     => '',
          :lastname      => '',
          :email         => '<EMAIL>',
          :login         => 'login-2',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :email     => '<EMAIL>',
          :login     => 'login-2',
        },
      },
      {
        :name => '#7 - simple create - nill as fristname and lastname',
        :create => {
          :firstname     => nil,
          :lastname      => nil,
          :email         => '<EMAIL>',
          :login         => 'login-3',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Firstname',
          :lastname  => 'Lastname',
          :email     => '<EMAIL>',
          :login     => 'login-3',
        },
      },
      {
        :name => '#8 - update with avatar check',
        :create => {
          :firstname     => 'Bob',
          :lastname      => 'Smith',
          :email         => '<EMAIL>',
          :login         => 'login-4',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Bob',
          :lastname  => 'Smith',
          :image     => 'none',
          :image_md5 => '76fdc28c07e4f3d7802b75aacfccdf6a',
          :email     => '<EMAIL>',
          :login     => 'login-4',
        },
        :update => {
          :email => '<EMAIL>',
        },
        :update_verify => {
          :firstname => 'Bob',
          :lastname  => 'Smith',
          :image     => 'a6f7f7f9dac25b2c023d403ef998801c',
          :image_md5 => 'a6f7f7f9dac25b2c023d403ef998801c',
          :email     => '<EMAIL>',
          :login     => 'login-4',
        }
      },
      {
        :name => '#9 - update create with avatar check',
        :create => {
          :firstname     => 'Bob',
          :lastname      => 'Smith',
          :email         => '<EMAIL>',
          :login         => 'login-5',
          :updated_by_id => 1,
          :created_by_id => 1,
        },
        :create_verify => {
          :firstname => 'Bob',
          :lastname  => 'Smith',
          :image     => 'fb83638ff260b20555b25173169135dd',
          :image_md5 => 'fb83638ff260b20555b25173169135dd',
          :email     => '<EMAIL>',
          :login     => 'login-5',
        },
        :update => {
          :email => '<EMAIL>',
        },
        :update_verify => {
          :firstname => 'Bob',
          :lastname  => 'Smith',
          :image     => 'a6f7f7f9dac25b2c023d403ef998801c',
          :image_md5 => 'a6f7f7f9dac25b2c023d403ef998801c',
          :email     => '<EMAIL>',
          :login     => 'login-5',
        }
      },
    ]

    tests.each { |test|

{'fraction_non_alphanumeric': 0.16786339754816113, 'fraction_numerical': 0.034238178633975484, 'mean_word_length': 1.2056778679026652, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 347, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1840905', 'n_tokens_mistral': 3697, 'n_tokens_neox': 3541, 'n_words': 632}