diff options
author | Frederick Cheung <frederick.cheung@gmail.com> | 2008-12-25 12:10:28 +0000 |
---|---|---|
committer | Frederick Cheung <frederick.cheung@gmail.com> | 2008-12-26 18:25:03 +0000 |
commit | d7b6e48c70076a7760e22c381e48834ecddfa6e3 (patch) | |
tree | c12cd1e7ae9b8ec1c136b3dd3d84dd63b20011ba /actionpack/test | |
parent | e898f82a743063652aed802d99ea8b5deac2ec3c (diff) | |
download | rails-d7b6e48c70076a7760e22c381e48834ecddfa6e3.tar.gz rails-d7b6e48c70076a7760e22c381e48834ecddfa6e3.tar.bz2 rails-d7b6e48c70076a7760e22c381e48834ecddfa6e3.zip |
Fix randomly failing cookie store tests
Marshal.dump(Marshal.load(marshaled_hash)) is not guarenteed to be equal to marshaled_hash
because of the lack of ordering of hash
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/session/cookie_store_test.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/test/controller/session/cookie_store_test.rb b/actionpack/test/controller/session/cookie_store_test.rb index 69aec59dc0..d349c18d1d 100644 --- a/actionpack/test/controller/session/cookie_store_test.rb +++ b/actionpack/test/controller/session/cookie_store_test.rb @@ -25,7 +25,7 @@ class CookieStoreTest < ActionController::IntegrationTest def set_session_value session[:foo] = "bar" - render :text => Marshal.dump(session.to_hash) + render :text => Verifier.generate(session.to_hash) end def get_session_value @@ -94,8 +94,7 @@ class CookieStoreTest < ActionController::IntegrationTest with_test_route_set do get '/set_session_value' assert_response :success - session_payload = Verifier.generate(Marshal.load(response.body)) - assert_equal ["_myapp_session=#{session_payload}; path=/"], + assert_equal ["_myapp_session=#{response.body}; path=/"], headers['Set-Cookie'] end end @@ -148,8 +147,8 @@ class CookieStoreTest < ActionController::IntegrationTest with_test_route_set do get '/set_session_value' assert_response :success - session_payload = Verifier.generate(Marshal.load(response.body)) - assert_equal ["_myapp_session=#{session_payload}; path=/"], + session_payload = response.body + assert_equal ["_myapp_session=#{response.body}; path=/"], headers['Set-Cookie'] get '/call_reset_session' |