From e2b97092e4fbe33efcd9520bce8501096df3862a Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sun, 29 Apr 2012 23:36:39 -0700 Subject: [PATCH] Failing test for #6034 --- .../application/middleware/session_test.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/railties/test/application/middleware/session_test.rb b/railties/test/application/middleware/session_test.rb index f4e77ee244..07134cc935 100644 --- a/railties/test/application/middleware/session_test.rb +++ b/railties/test/application/middleware/session_test.rb @@ -26,5 +26,25 @@ module ApplicationTests require "#{app_path}/config/environment" assert app.config.session_options[:secure], "Expected session to be marked as secure" end + + test "session is not loaded if it's not used" do + make_basic_app + + class ::OmgController < ActionController::Base + def index + if params[:flash] + flash[:notice] = "notice" + end + + render :nothing => true + end + end + + get "/?flash=true" + get "/" + + assert last_request.env["HTTP_COOKIE"] + assert !last_response.headers["Set-Cookie"] + end end end