Browse files

Failing test for #6034

  • Loading branch information...
1 parent 88b5f94 commit e2b97092e4fbe33efcd9520bce8501096df3862a @drogus drogus committed Apr 29, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 railties/test/application/middleware/session_test.rb
View
20 railties/test/application/middleware/session_test.rb
@@ -26,5 +26,25 @@ def app
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

0 comments on commit e2b9709

Please sign in to comment.