From 2b2983d76fd11efc219273036a612f47cfaa5bfa Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sun, 29 Apr 2012 23:36:39 -0700 Subject: Failing test for #6034 --- railties/test/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 9f39e18a74..aee2417abc 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 -- cgit v1.2.3