<commit_before>require 'test_helper'

class SessionsControllerTest < ActionController::TestCase
  test "should get new" do
    get :new
    assert_response :success
    assert_nil assigns(:users)
    assert_template :new
  end

  test "Should create new session" do
  	post :create, { email: "<EMAIL>", password: "<PASSWORD>" }
  	assert_not_nil session[:user_id]
  	assert_equal  "Logged in!", flash[:notice]
    assert_response :success
  end

  test "Should destroy session" do
  	get :destroy
  	assert_nil session[:user_id]
  	assert_equal  "Logged out!", flash[:notice]
  end

  test "Should fail create new session" do
  	post :create, { email: "<EMAIL>", password: "<PASSWORD>" }
  	assert_nil session[:user_id]
  	assert_equal  "Invalid email or password", flash[:alert]
  end

end
<commit_msg>Update sessions_controller_test.rb<commit_after>require 'test_helper'

class SessionsControllerTest < ActionController::TestCase
  test "should get new" do
    get :new
    assert_response :success
    assert_nil assigns(:users)
    assert_template :new
  end

  test "Should create new session" do
  	post :create, { email: "<EMAIL>", password: "<PASSWORD>" }
  	assert_not_nil session[:user_id]
  	assert_equal  "Logged in!", flash[:notice]
    assert_response :redirect
  end

  test "Should destroy session" do
  	get :destroy
  	assert_nil session[:user_id]
  	assert_equal  "Logged out!", flash[:notice]
  end

  test "Should fail create new session" do
  	post :create, { email: "<EMAIL>", password: "<PASSWORD>" }
  	assert_nil session[:user_id]
  	assert_equal  "Invalid email or password", flash[:alert]
  end

end

{'fraction_non_alphanumeric': 0.10257985257985258, 'fraction_numerical': 0.0, 'mean_word_length': 4.271844660194175, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '5098230', 'n_tokens_mistral': 522, 'n_tokens_neox': 511, 'n_words': 155}