<commit_before>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe FrontpageController do
  include ActionController::AuthenticationTestHelper
  
  integrate_views

  describe "when Anonymous" do
    it "should render index" do
      get :index
      assert_response :success
    end
  end

  describe "when authenticated" do
    before do
      login_as Factory(:user)
    end

    it "should render index" do
      get :index
      assert_response :success
    end
  end
end
  <commit_msg>Corrected the index page test: user is now redirected to his homepage if logged in<commit_after>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe FrontpageController do
  include ActionController::AuthenticationTestHelper
  
  integrate_views

  describe "when Anonymous" do
    it "should render index" do
      get :index
      assert_response :success
    end
  end

  describe "when authenticated" do
    before do
      login_as Factory(:user)
    end

    it "should redirect to home" do
      get :index
      response.should redirect_to(home_path)
    end
  end
end
  
{'fraction_non_alphanumeric': 0.06144256455921639, 'fraction_numerical': 0.0, 'mean_word_length': 3.1476014760147604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1681954', 'n_tokens_mistral': 323, 'n_tokens_neox': 310, 'n_words': 105}