<commit_before>require 'test_helper'

class AuthorizationTest < ActionDispatch::IntegrationTest
  def setup
    @user = create :user
    log_in_as @user
  end

  describe 'logging in successfully' do 
    it 'should display a success message after successful login' do 
      assert_text 'Signed in successfully.'
    end
  end

  describe 'the page navbar' do 
    it 'should have a name in the top corner' do 
      assert has_link? @user.name, href: edit_user_registration_path
    end

    it 'should have a sign out link' do 
      assert has_link? 'Sign out', href: destroy_user_session_path
    end
  end

  # describe 'logging in unsuccessfully' do
  #   before do 
  #     sign_out 

  #   end

  #   it 'should bump you back to root' do 
  #     assert_equal current_path, root_path
  #   end

  #   it 'should not display your name' do 
  #     assert_no_text @user.name


  #   end

  #   # it 'should display a status message' do 
  #   # end
  # end

  # describe 'alter user info' do 
    # it 'should let you change name and email' do 
    # end

  #   it 'should let you change email' do 
  #   end 

  #   it 'should let you change your password' do <commit_msg>unsuccessful login auth test<commit_after>require 'test_helper'

class AuthorizationTest < ActionDispatch::IntegrationTest
  def setup
    @user = create :user
    log_in_as @user
  end

  describe 'logging in successfully' do 
    it 'should display a success message after successful login' do 
      assert_text 'Signed in successfully.'
    end
  end

  describe 'the page navbar' do 
    it 'should have a name in the top corner' do 
      assert has_link? @user.name, href: edit_user_registration_path
    end

    it 'should have a sign out link' do 
      assert has_link? 'Sign out', href: destroy_user_session_path
    end
  end

  describe 'logging in unsuccessfully' do
    it 'should bump you back to root' do 
      sign_out
      @user.password = '<PASSWORD>'
      log_in_as @user
      assert_equal current_path, new_user_session_path
      assert_text 'Invalid email or password.'
      assert_no_text @user.name
    end
  end

  # describe 'alter user info' do 
    # it 'should let you change name and email' do 
    # end

  #   it 'should let you change email' do 
  #   end 

  #   it 'should let you change your password' do 
{'fraction_non_alphanumeric': 0.060970373550880204, 'fraction_numerical': 0.0, 'mean_word_length': 2.675078864353312, 'pattern_counts': {'":': 0, '<': 6, '<?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': '6945602', 'n_tokens_mistral': 736, 'n_tokens_neox': 688, 'n_words': 277}