<commit_before>require "rack/test"

RSpec.describe "Full stack application" do
  include Rack::Test::Methods

  def app
    FullStack::Application.new
  end

  it "passes action inside the Rack env" do
    get "/", {}, "HTTP_ACCEPT" => "text/html"

    expect(last_response.body).to include("FullStack::Controllers::Home::Index")
    expect(last_response.body).to include(':greeting=>"Hello"')
  end

  it "in case of redirect and invalid params, it passes errors in session and then deletes them" do<commit_msg>update spec to reflect the current behavior regarding HEAD request and entity headers<commit_after>require "rack/test"

RSpec.describe "Full stack application" do
  include Rack::Test::Methods

  def app
    FullStack::Application.new
  end

  it "passes action inside the Rack env" do
    get "/", {}, "HTTP_ACCEPT" => "text/html"

    expect(last_response.body).to include("FullStack::Controllers::Home::Index")
    expect(last_response.body).to include(':greeting=>"Hello"')
  end

  it "only allows entity headers if the request is HEAD" do
    head "/head", {}, "HTTP_ACCEPT" => "text/html"

    expect(last_response.headers).to_not have_key("X-Renderable")
  end

  it "in case of redirect and invalid params, it passes errors in session and then deletes them" do
{'fraction_non_alphanumeric': 0.11631537861046058, 'fraction_numerical': 0.0, 'mean_word_length': 4.478632478632479, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6609593', 'n_tokens_mistral': 394, 'n_tokens_neox': 381, 'n_words': 123}