<commit_before>require 'spec_helper'

describe Debt do

  ##########
  describe "Validations" do
    describe "responds to " do
      characteristics = [:permit_infraction_number, :amount_owed_pending_balance, :paid_in_full,                   
        :type_of_debt, :original_debt_date, :originating_debt_amount, :bank_name,
        :bounced_check_number, :in_payment_plan, :in_administrative_process,       
        :contact_person_for_transactions, :notes, :debtor_id, :created_at, :updated_at,
        :fimas_project_id, :fimas_budget_reference, :fimas_class_field, :fimas_program, 
        :fimas_fund_code, :fimas_account, :fimas_id, :debtor]
      characteristics.each do |type|
        it {should respond_to(type.to_sym)}
      end
    end
    
    it 'shoud validate amount owed is a number' do
      debt1 = FactoryGirl.build(:debt, amount_owed_pending_balance: "hello world")
      debt2 = FactoryGirl.build(:debt, amount_owed_pending_balance: "12.00")
      # puts debt1.inspect
      # puts debt2.inspect
      puts "It seems to be clobbering the value entered. So it will always be valid."
      expect(debt2.valid?).to be true
      expect(debt1.valid?).to be_falsy
      # expect(debt2.errors[:amount_owed_pending_balance].size).to eq(0)
      # debt1.valid?
      <commit_msg>changed from rspec 3.0 be true to eq true on spec<commit_after>require 'spec_helper'

describe Debt do

  ##########
  describe "Validations" do
    describe "responds to " do
      characteristics = [:permit_infraction_number, :amount_owed_pending_balance, :paid_in_full,                   
        :type_of_debt, :original_debt_date, :originating_debt_amount, :bank_name,
        :bounced_check_number, :in_payment_plan, :in_administrative_process,       
        :contact_person_for_transactions, :notes, :debtor_id, :created_at, :updated_at,
        :fimas_project_id, :fimas_budget_reference, :fimas_class_field, :fimas_program, 
        :fimas_fund_code, :fimas_account, :fimas_id, :debtor]
      characteristics.each do |type|
        it {should respond_to(type.to_sym)}
      end
    end
    
    it 'shoud validate amount owed is a number' do
      debt1 = FactoryGirl.build(:debt, amount_owed_pending_balance: "hello world")
      debt2 = FactoryGirl.build(:debt, amount_owed_pending_balance: "12.00")
      # puts debt1.inspect
      # puts debt2.inspect
      puts "It seems to be clobbering the value entered. So it will always be valid."
      expect(debt2.valid?).to eq true
      expect(debt1.valid?).to be_falsy
      # expect(debt2.errors[:amount_owed_pending_balance].size).to eq(0)
      # debt1.valid?
      
{'fraction_non_alphanumeric': 0.09801678108314264, 'fraction_numerical': 0.010678871090770405, 'mean_word_length': 3.4158249158249157, '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': '6167318', 'n_tokens_mistral': 903, 'n_tokens_neox': 847, 'n_words': 188}