<commit_before>require 'rails_helper'

RSpec.describe User, :type => :model do
  describe User do
    it { should have_many(:posts).dependent(:destroy)}

    describe "#password" do
      it { should have_valid(:password).when("<PASSWORD>", "asd^2jk@%#&!!") }
      it { should_not have_valid(:password).when("<PASSWORD>", nil, "") }
    end

    describe "#password_confirmation" do
      subject { FactoryGirl.build(:user, password: "<PASSWORD>") }
      it { should have_valid(:password_confirmation).when("<PASSWORD>") }
      it { should_not have_valid(:password_confirmation).when("asdfg") }
    end

    describe "#email" do
      subject { FactoryGirl.create(:user) }
      it { should have_valid(:email).when("<EMAIL>", "<EMAIL>") }
      it { should_not have_valid(:email).when("asf", "example.<EMAIL>", "me@", nil, "") }
      it { should validate_uniqueness_of(:email) }
    end
  end
end<commit_msg>Passes kit and user model tests.<commit_after>require 'rails_helper'

RSpec.describe User, :type => :model do
  describe User do
    it { should have_many(:posts).dependent(:destroy)}

    describe "#password" do
      it { should have_valid(:password).when("<PASSWORD>", "<PASSWORD>@%#&!!") }
      it { should_not have_valid(:password).when("<PASSWORD>", nil, "") }
    end

    describe "#password_confirmation" do
      subject { FactoryGirl.build(:user, password: "<PASSWORD>") }
      it { should have_valid(:password_confirmation).when("<PASSWORD>") }
      it { should_not have_valid(:password_confirmation).when("asdfg") }
    end

    describe "#practitioner_email" do
      subject { FactoryGirl.create(:user, :practitioner) }
      it { should have_valid(:email).when("<EMAIL>", "<EMAIL>") }
      it { should_not have_valid(:email).when("asf", "example.<EMAIL>", "me@", nil, "") }
      it { should validate_uniqueness_of(:email) }
    end

    describe "#client_email" do
      subject { FactoryGirl.create(:user, :client) }
      it { should have_valid(:email).when("<EMAIL>", "<EMAIL>") }
      it { should_not have_valid(:email).when("asf", "example.com", "me@", nil, "") }
      it { should validate_uniqueness_of(:email) }
    end
  end
end
{'fraction_non_alphanumeric': 0.16812528788576692, 'fraction_numerical': 0.00046061722708429296, 'mean_word_length': 3.958904109589041, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 22, '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': '1648375', 'n_tokens_mistral': 684, 'n_tokens_neox': 677, 'n_words': 145}