<commit_before>require 'rails_helper'

RSpec.describe Offspring, type: :model do
  active_record_offspring = 'activerecord.errors.models.offspring.attributes'
  describe "validating attribute first_name " do
    it "is invalid without first_name" do
      off = FactoryGirl.build(:offspring, first_name: "")
      off.valid?
      expect(off.errors[:first_name]).to include(I18n.t('first_name.blank', scope: active_record_offspring))
      off.first_name = "Foo"
      expect(off).to be_valid
    end

    it "is invalid with less than 1 character" do
      off = FactoryGirl.build(:offspring, first_name: 'a')
      off.valid?
      expect(off.errors[:first_name]).to include(I18n.t('first_name.too_short', count:2, scope: active_record_offspring))
      off.first_name = 'aa'
      expect(off).to be_valid
    end

    it "is invalid with more than 60 characters" do
      off = FactoryGirl.build(:offspring, first_name: 'a' * 61)
      off.valid?
      expect(off.errors[:first_name]).to include(I18n.t('first_name.too_long', count:60, scope: active_record_offspring))
      off.first_name = 'a' * 60
      expect(off).to be_valid
    end
  end
  describe "validating attribute last_name " do
    it "is invalid without last_name" do
      off = FactoryGirl.build(:offspring, last_name: "")
      off.valid?
      expect(off.errors[:last_name]).to include(I18n.t('last_name.blank', scope: active_record_offspring))
      off.last_name = "Richardson"
      expect(off).to be_valid
    end

    it "is invalid with less than 2 characters" do
      off = FactoryGirl.build(:offspring, last_name: 'a')
      off.valid?
      expect(off.errors[:last_name]).to include(I18n.t('last_name.too_short', count:2, scope: active_record_offspring))
      off.last_name = 'aa'
      expect(off).to be_valid
    end

    it "is invalid with more than 60 characters" do
      off = FactoryGirl.build(:offspring, last_name: 'a' * 61)
      off.valid?
      expect(off.errors[:last_name]).to include(I18n.t('last_name.too_long', count: 60, scope: active_record_offspring))
      off.last_name = 'a' * 60
      expect(off).to be_valid
    end
  end
  pending("it can identify its parent class")
  pending("it cannot exist without parent")
  pending("subclass must be able to identify with is parent class")
  pending("subclass must be able to identify its class")
  pending("always has a parent associated to it")
  pending("deletes all child classes when parent class destroyed")
  pending("has config in yaml for the type of kids they have")
  pending("has all attributes validated")
  pending("courses are defined with an enum")
end<commit_msg>Added a pending example to specs<commit_after>require 'rails_helper'

RSpec.describe Offspring, type: :model do
  active_record_offspring = 'activerecord.errors.models.offspring.attributes'
  describe "validating attribute first_name " do
    it "is invalid without first_name" do
      off = FactoryGirl.build(:offspring, first_name: "")
      off.valid?
      expect(off.errors[:first_name]).to include(I18n.t('first_name.blank', scope: active_record_offspring))
      off.first_name = "Foo"
      expect(off).to be_valid
    end

    it "is invalid with less than 1 character" do
      off = FactoryGirl.build(:offspring, first_name: 'a')
      off.valid?
      expect(off.errors[:first_name]).to include(I18n.t('first_name.too_short', count:2, scope: active_record_offspring))
      off.first_name = 'aa'
      expect(off).to be_valid
    end

    it "is invalid with more than 60 characters" do
      off = FactoryGirl.build(:offspring, first_name: 'a' * 61)
      off.valid?
      expect(off.errors[:first_name]).to include(I18n.t('first_name.too_long', count:60, scope: active_record_offspring))
      off.first_name = 'a' * 60
      expect(off).to be_valid
    end
  end
  describe "validating attribute last_name " do
    it "is invalid without last_name" do
      off = FactoryGirl.build(:offspring, last_name: "")
      off.valid?
      expect(off.errors[:last_name]).to include(I18n.t('last_name.blank', scope: active_record_offspring))
      off.last_name = "Richardson"
      expect(off).to be_valid
    end

    it "is invalid with less than 2 characters" do
      off = FactoryGirl.build(:offspring, last_name: 'a')
      off.valid?
      expect(off.errors[:last_name]).to include(I18n.t('last_name.too_short', count:2, scope: active_record_offspring))
      off.last_name = 'aa'
      expect(off).to be_valid
    end

    it "is invalid with more than 60 characters" do
      off = FactoryGirl.build(:offspring, last_name: 'a' * 61)
      off.valid?
      expect(off.errors[:last_name]).to include(I18n.t('last_name.too_long', count: 60, scope: active_record_offspring))
      off.last_name = 'a' * 60
      expect(off).to be_valid
    end
  end
  pending("it can identify its parent class")
  pending("it cannot exist without parent")
  pending("subclass must be able to identify with is parent class")
  pending("subclass must be able to identify its class")
  pending("always has a parent associated to it")
  pending("deletes all child classes when parent class destroyed")
  pending("has config in yaml for the type of kids they have")
  pending("has all attributes validated")
  pending("courses are defined with an enum")
  pending("has a max and min age definde in config yaml file")
end
{'fraction_non_alphanumeric': 0.10932235117933359, 'fraction_numerical': 0.011980531636091352, 'mean_word_length': 3.690956979806848, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2336367', 'n_tokens_mistral': 1735, 'n_tokens_neox': 1648, 'n_words': 469}