Ticket #7372: fix_indifferent_access_for_session_batch_assignment.diff
| File fix_indifferent_access_for_session_batch_assignment.diff, 1.7 kB (added by manfred, 2 years ago) |
|---|
-
test/controller/test_test.rb
old new 13 13 session[:symbol] = 'it works' 14 14 render :text => 'Success' 15 15 end 16 17 def set_from_session 18 @string = session['string'] 19 @symbol = session[:symbol] 20 render :nothing => true 21 end 16 22 17 23 def render_raw_post 18 24 raise Test::Unit::AssertionFailedError, "#raw_post is blank" if request.raw_post.blank? … … 124 130 assert_equal 'it works', session['symbol'], "Test session hash should allow indifferent access" 125 131 assert_equal 'it works', session[:symbol], "Test session hash should allow indifferent access" 126 132 end 133 134 def test_process_with_session_defined 135 process :set_from_session, {}, {:symbol => 'Symbol', 'string' => 'String'} 136 assert_equal 'Symbol', assigns(:symbol) 137 assert_equal 'String', assigns(:string) 138 assert_equal 'Symbol', session['symbol'] 139 assert_equal 'String', session[:string] 140 end 127 141 128 142 def test_process_with_request_uri_with_no_params 129 143 process :test_uri -
lib/action_controller/test_process.rb
old new 283 283 284 284 def initialize(attributes = nil) 285 285 @session_id = '' 286 @attributes = attributes 286 unless attributes.nil? 287 attributes.each { |k,v| self[k] = v } 288 else 289 @attributes = nil 290 end 287 291 @saved_attributes = nil 288 292 end 289 293