<commit_before>require 'spec_helper'

describe Bill do
  it {should have_many(:votes)}
  it {should validate_presence_of(:sun_bill_id)}
  it {should validate_uniqueness_of(:sun_bill_id)}
  it {should validate_presence_of(:official_title)}
  it {should validate_presence_of(:summary_short)}

  it 'should find existing bills given an array of roll_ids' do
    bill = FactoryGirl.create(:bill)
    gotten_bill = Bill.get_bills(['s744-113'])
    expect(gotten_bill[0].official_title).to eq('Best Bill')
  end

  # this is returning true for new_bill.  not sure how to structure this, since it's supposed to be creating a new bill when one doesn't exist.  
  pending 'should create a bill if no bill already exists' do
    bill = FactoryGirl.create(:bill)
    new_bill = Bill.get_bills(['s1243-113'])
    expect(new_bill[0].id).to be > 0
  end

end
<commit_msg>add pending test for get_bills method + cosmetic<commit_after>require 'spec_helper'

describe Bill do
  it {should have_many(:votes)}
  it {should validate_presence_of(:sun_bill_id)}
  it {should validate_uniqueness_of(:sun_bill_id)}
  it {should validate_presence_of(:official_title)}
  it {should validate_presence_of(:summary_short)}

  it 'should find existing bills given an array of roll_ids' do
    bill = FactoryGirl.create( :bill )
    gotten_bill = Bill.get_bills( ['s744-113'] )
    expect( gotten_bill[0].official_title ).to eq( 'Best Bill' )
  end

  # figure out how to test the ability of self.get_bills to pass a bill not in the database to self.create_bill

  pending 'should create a bill with a valid and initialized bill object and a sun_bill_id' do
    bill = FactoryGirl.create( :bill )
  end

end

{'fraction_non_alphanumeric': 0.09063804412641623, 'fraction_numerical': 0.013714967203339297, 'mean_word_length': 4.556291390728477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2816910', 'n_tokens_mistral': 582, 'n_tokens_neox': 535, 'n_words': 174}