Changeset 1371
- Timestamp:
- 05/30/05 09:00:46 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/benchmarking.rb (modified) (2 diffs)
- trunk/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb (modified) (1 diff)
- trunk/actionpack/test/controller/new_render_test.rb (modified) (3 diffs)
- trunk/actionpack/test/controller/render_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r1369 r1371 1 1 *SVN* 2 3 * Make sure the benchmarking render method always returns the output of the render. 2 4 3 5 * render(:text), render(:partial), and render(:nothing) always default to :layout => false. This also fixes send_file, which was applying a layout if one existed for the current action. trunk/actionpack/lib/action_controller/benchmarking.rb
r1350 r1371 21 21 else 22 22 db_runtime = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? 23 @rendering_runtime = Benchmark::measure{ render_without_benchmark(options, deprecated_status) }.real 23 24 render_output = nil 25 @rendering_runtime = Benchmark::measure{ render_output = render_without_benchmark(options, deprecated_status) }.real 24 26 25 27 if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? … … 28 30 @rendering_runtime -= @db_rt_after_render 29 31 end 32 33 render_output 30 34 end 31 35 end trunk/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb
r1283 r1371 19 19 20 20 private 21 MULTIPART_FORM_BOUNDARY_RE = %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|n #" 21 unless defined?(MULTIPART_FORM_BOUNDARY_RE) 22 MULTIPART_FORM_BOUNDARY_RE = %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|n #" 23 end 22 24 23 25 def multipart_form_boundary trunk/actionpack/test/controller/new_render_test.rb
r1369 r1371 10 10 end 11 11 12 13 class TestController < ActionController::Base 12 class NewRenderTestController < ActionController::Base 14 13 layout :determine_layout 14 15 def self.controller_name; "test"; end 16 def self.controller_path; "test"; end 15 17 16 18 def hello_world … … 104 106 end 105 107 106 TestController.template_root = File.dirname(__FILE__) + "/../fixtures/"108 NewRenderTestController.template_root = File.dirname(__FILE__) + "/../fixtures/" 107 109 Fun::GamesController.template_root = File.dirname(__FILE__) + "/../fixtures/" 108 110 109 class TestLayoutController < ActionController::Base 110 layout "layouts/standard" 111 112 def hello_world 113 end 114 115 def hello_world_outside_layout 116 end 117 118 def rescue_action(e) 119 raise unless ActionController::MissingTemplate === e 120 end 121 end 122 123 class RenderTest < Test::Unit::TestCase 111 class NewRenderTest < Test::Unit::TestCase 124 112 def setup 125 @controller = TestController.new 113 @controller = NewRenderTestController.new 114 115 # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get 116 # a more accurate simulation of what happens in "real life". 117 @controller.logger = Logger.new(nil) 118 126 119 @request = ActionController::TestRequest.new 127 120 @response = ActionController::TestResponse.new … … 245 238 assert_equal "Hello: David", @response.body 246 239 end 247 248 private249 def process_request250 TestController.process(@request, @response)251 end252 240 end trunk/actionpack/test/controller/render_test.rb
r1307 r1371 1 1 require File.dirname(__FILE__) + '/../abstract_unit' 2 2 3 Customer = Struct.new("Customer", :name) 3 unless defined?(Customer) 4 Customer = Struct.new("Customer", :name) 5 end 4 6 5 7 module Fun