Skip to content
Browse files

Failing test for #6034

  • Loading branch information...
1 parent d625a7a commit e23e684d3551ea7f0098724689350b83f889d045 @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 e23e684

Please sign in to comment.
Something went wrong with that request. Please try again.