<commit_before>require 'spec_helper'

describe User do

  let(:user) { FactoryGirl.build(:user) }

  it "has valid factory" do
    FactoryGirl.build(:user).should be_valid
  end

  describe "validation" do
    let(:user) { Factory(:user) }

    it "validates nickname uniqueness" do
      new_user = Factory.build(:user)
      new_user.nickname = user.nickname

      new_user.should_not be_valid
      new_user.should have(1).error_on(:nickname)
    end
  end

  describe ".create_with_omniauth" do
    let(:uid)      { "123" }
    let(:provider) { "twitter" }
    let(:nickname) { "foo" }
    let(:name)     { "<NAME>" }

    let(:auth) do
      {
        "provider" => provider,
        "uid" => uid,<commit_msg>Use new factory_girl syntax<commit_after>require 'spec_helper'

describe User do

  let(:user) { FactoryGirl.build(:user) }

  it "has valid factory" do
    FactoryGirl.build(:user).should be_valid
  end

  describe "validation" do
    let(:user) { Factory(:user) }

    it "validates nickname uniqueness" do
      new_user = FactoryGirl.build(:user)
      new_user.nickname = user.nickname

      new_user.should_not be_valid
      new_user.should have(1).error_on(:nickname)
    end
  end

  describe ".create_with_omniauth" do
    let(:uid)      { "123" }
    let(:provider) { "twitter" }
    let(:nickname) { "foo" }
    let(:name)     { "<NAME>" }

    let(:auth) do
      {
        "provider" => provider,
        "uid" => uid,
{'fraction_non_alphanumeric': 0.13259668508287292, 'fraction_numerical': 0.0055248618784530384, 'mean_word_length': 2.7931937172774868, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6505916', 'n_tokens_mistral': 506, 'n_tokens_neox': 474, 'n_words': 106}