Changeset 8782
- Timestamp:
- 02/02/08 05:32:44 (5 months ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/test_process.rb (modified) (2 diffs)
- trunk/actionpack/test/controller/test_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r8748 r8782 1 1 *SVN* 2 3 * TestSession supports indifferent access. #7372 [tamc, Arsen7, mhackett, julik, jean.helou] 2 4 3 5 * Make assert_routing aware of the HTTP method used. #8039 [mpalmer] trunk/actionpack/lib/action_controller/test_process.rb
r8570 r8782 288 288 def initialize(attributes = nil) 289 289 @session_id = '' 290 @attributes = attributes 290 @attributes = attributes.nil? ? nil : attributes.stringify_keys 291 291 @saved_attributes = nil 292 292 end … … 297 297 298 298 def [](key) 299 data[key ]299 data[key.to_s] 300 300 end 301 301 302 302 def []=(key, value) 303 data[key ] = value303 data[key.to_s] = value 304 304 end 305 305 trunk/actionpack/test/controller/test_test.rb
r8748 r8782 4 4 class TestTest < Test::Unit::TestCase 5 5 class TestController < ActionController::Base 6 def no_op 7 render :text => 'dummy' 8 end 9 6 10 def set_flash 7 11 flash["test"] = ">#{flash["test"]}<" 8 12 render :text => 'ignore me' 13 end 14 15 def set_session 16 session['string'] = 'A wonder' 17 session[:symbol] = 'it works' 18 render :text => 'Success' 9 19 end 10 20 … … 136 146 end 137 147 148 def test_process_with_session 149 process :set_session 150 assert_equal 'A wonder', session['string'], "A value stored in the session should be available by string key" 151 assert_equal 'A wonder', session[:string], "Test session hash should allow indifferent access" 152 assert_equal 'it works', session['symbol'], "Test session hash should allow indifferent access" 153 assert_equal 'it works', session[:symbol], "Test session hash should allow indifferent access" 154 end 155 156 def test_process_with_session_arg 157 process :no_op, nil, { 'string' => 'value1', :symbol => 'value2' } 158 assert_equal 'value1', session['string'] 159 assert_equal 'value1', session[:string] 160 assert_equal 'value2', session['symbol'] 161 assert_equal 'value2', session[:symbol] 162 end 163 138 164 def test_process_with_request_uri_with_no_params 139 165 process :test_uri