Skip to content
This repository
Browse code

Failing test for #6034

  • Loading branch information...
commit 2b2983d76fd11efc219273036a612f47cfaa5bfa 1 parent e3069c6
Piotr Sarnacki authored April 29, 2012
20  railties/test/application/middleware/session_test.rb
@@ -26,5 +26,25 @@ def app
26 26
       require "#{app_path}/config/environment"
27 27
       assert app.config.session_options[:secure], "Expected session to be marked as secure"
28 28
     end
  29
+
  30
+    test "session is not loaded if it's not used" do
  31
+      make_basic_app
  32
+
  33
+      class ::OmgController < ActionController::Base
  34
+        def index
  35
+          if params[:flash]
  36
+            flash[:notice] = "notice"
  37
+          end
  38
+
  39
+          render :nothing => true
  40
+        end
  41
+      end
  42
+
  43
+      get "/?flash=true"
  44
+      get "/"
  45
+
  46
+      assert last_request.env["HTTP_COOKIE"]
  47
+      assert !last_response.headers["Set-Cookie"]
  48
+    end
29 49
   end
30 50
 end

0 notes on commit 2b2983d

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