<commit_before># require 'spec_helper'
require 'rails_helper'
 
describe SessionsController do
 
  before do
    request.env['omniauth.auth'] = OmniAuth.config.mock_auth[:github]
  end
 
  describe "#create" do
 
    it "should successfully create a user" do
      expect {
        post :create, provider: :github
      }.to change{ User.count }.by(1)
    end
 
    it "should successfully create a session" do
      expect(session[:user_id]).to be_nil
      post :create, provider: :github
      expect(session[:user_id]).to_not be_nil
    end
 
    it "should redirect the user to the root url" do
      post :create, provider: :github
      expect(response).to redirect_to(root_url)<commit_msg>modified before block to declare example hash for sessions controller<commit_after>require 'spec_helper'
require 'rails_helper'
 
describe SessionsController do
 
  before do
    request.env['omniauth.auth'] = OmniAuth::AuthHash.new({
      :provider => 'github',
      :uid => '123545',
      :info => {
                :name => "<NAME>",
                :nickname => "Rand" 
      }
    })

  end
 
  describe "#create" do
 
    it "should successfully create a user" do
      post :create, provider: :github
      expect(User.count).to eq(1)
    end
 
    it "should successfully create a session" do
      expect(session[:user_id]).to be_nil 
      post :create, provider: :github
      expect(session[:user_id]).to_not be_nil
    end
 
    it "should redirect the user to the root url" do
      post :create, provider: :github
      expect(response).to redirect_to(root_url)
{'fraction_non_alphanumeric': 0.10279187817258884, 'fraction_numerical': 0.005076142131979695, 'mean_word_length': 2.8369829683698295, 'pattern_counts': {'":': 0, '<': 4, '<?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': '4322948', 'n_tokens_mistral': 491, 'n_tokens_neox': 449, 'n_words': 143}