From 6d3122445c4778ec85ce7fe66126845c4100304d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 17 May 2011 17:43:44 -0400 Subject: Ensure Set-Cookie is not set on assets. --- railties/test/application/assets_test.rb | 49 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'railties') diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 624dd2a23f..98a702f134 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -24,35 +24,36 @@ module ApplicationTests end RUBY + require "#{app_path}/config/environment" + get "/assets/demo.js" assert_match "alert()", last_response.body end test "does not stream session cookies back" do - puts "PENDING SPROCKETS AND RACK RELEASE" - # app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();" - # - # app_file "config/routes.rb", <<-RUBY - # AppTemplate::Application.routes.draw do - # match '/omg', :to => "omg#index" - # end - # RUBY - # - # require "#{app_path}/config/environment" - # - # class ::OmgController < ActionController::Base - # def index - # flash[:cool_story] = true - # render :text => "ok" - # end - # end - # - # get "/omg" - # assert_equal 'ok', last_response.body - # - # get "/assets/demo.js" - # assert_match "alert()", last_response.body - # assert_equal nil, last_response.headers["Set-Cookie"] + app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();" + + app_file "config/routes.rb", <<-RUBY + AppTemplate::Application.routes.draw do + match '/omg', :to => "omg#index" + end + RUBY + + require "#{app_path}/config/environment" + + class ::OmgController < ActionController::Base + def index + flash[:cool_story] = true + render :text => "ok" + end + end + + get "/omg" + assert_equal 'ok', last_response.body + + get "/assets/demo.js" + assert_match "alert()", last_response.body + assert_equal nil, last_response.headers["Set-Cookie"] end end end -- cgit v1.2.3