<commit_before>require 'spec_helper'

describe Authentication do
  before do
    @user = FactoryGirl.create(:user)
    @auth = @user.authentications.create!(provider: 'github', uid: '12345')
  end

  it 'must have an associated user' do
    # Bryan: validations done at database level to avoid complications, but will raise exceptions
    @auth.user_id = nil
    expect{ @auth.save }.to raise_error
  end

  it 'must have an associated provider' do
    @auth.provider = nil
    expect(@auth.save).to be_false
  end

  it 'must have an associated UID' do
    @auth.uid = nil
    expect(@auth.save).to be_false
  end

  it 'must have a unique user-provider combination' do
    auth = @user.authentications.build(provider: 'github', uid: '098766')
    expect(auth.save).to be_false
  end
end
<commit_msg>Converting Authentication Model Spec to Rspec 3 syntax<commit_after>require 'spec_helper'

describe Authentication, :type => :model do
  before do
    @user = FactoryGirl.create(:user)
    @auth = @user.authentications.create!(provider: 'github', uid: '12345')
  end

  it 'must have an associated user' do
    # Bryan: validations done at database level to avoid complications, but will raise exceptions
    @auth.user_id = nil
    expect{ @auth.save }.to raise_error
  end

  it 'must have an associated provider' do
    @auth.provider = nil
    expect(@auth).to_not be_valid
  end

  it 'must have an associated UID' do
    @auth.uid = nil
    expect(@auth).to_not be_valid
  end

  it 'must have a unique user-provider combination' do
    auth = @user.authentications.build(provider: 'github', uid: '098766')
    expect(auth).to_not be_valid
  end
end

{'fraction_non_alphanumeric': 0.09656004828002414, 'fraction_numerical': 0.01388050694025347, 'mean_word_length': 3.6055555555555556, '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': '4720002', 'n_tokens_mistral': 539, 'n_tokens_neox': 504, 'n_words': 175}