Changeset 8783
- Timestamp:
- 02/02/08 05:34:28 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2-0-stable/actionpack/CHANGELOG
r8618 r8783 1 1 *SVN* 2 3 * TestSession supports indifferent access. #7372 [tamc, Arsen7, mhackett, julik, jean.helou] 2 4 3 5 * UrlWriter respects relative_url_root. #10748 [Cheah Chu Yeow] branches/2-0-stable/actionpack/lib/action_controller/test_process.rb
r8318 r8783 287 287 def initialize(attributes = nil) 288 288 @session_id = '' 289 @attributes = attributes 289 @attributes = attributes.nil? ? nil : attributes.stringify_keys 290 290 @saved_attributes = nil 291 291 end … … 296 296 297 297 def [](key) 298 data[key ]298 data[key.to_s] 299 299 end 300 300 301 301 def []=(key, value) 302 data[key ] = value302 data[key.to_s] = value 303 303 end 304 304 branches/2-0-stable/actionpack/test/controller/test_test.rb
r8498 r8783 5 5 class TestTest < Test::Unit::TestCase 6 6 class TestController < ActionController::Base 7 def no_op 8 render :text => 'dummy' 9 end 10 7 11 def set_flash 8 12 flash["test"] = ">#{flash["test"]}<" 9 13 render :text => 'ignore me' 14 end 15 16 def set_session 17 session['string'] = 'A wonder' 18 session[:symbol] = 'it works' 19 render :text => 'Success' 10 20 end 11 21 … … 137 147 end 138 148 149 def test_process_with_session 150 process :set_session 151 assert_equal 'A wonder', session['string'], "A value stored in the session should be available by string key" 152 assert_equal 'A wonder', session[:string], "Test session hash should allow indifferent access" 153 assert_equal 'it works', session['symbol'], "Test session hash should allow indifferent access" 154 assert_equal 'it works', session[:symbol], "Test session hash should allow indifferent access" 155 end 156 157 def test_process_with_session_arg 158 process :no_op, nil, { 'string' => 'value1', :symbol => 'value2' } 159 assert_equal 'value1', session['string'] 160 assert_equal 'value1', session[:string] 161 assert_equal 'value2', session['symbol'] 162 assert_equal 'value2', session[:symbol] 163 end 164 139 165 def test_process_with_request_uri_with_no_params 140 166 process :test_uri