Methods
- S
- T
-
- test_clear_sweep,
- test_delete,
- test_delete_sweep,
- test_discard_no_args,
- test_discard_one_arg,
- test_discard_then_add,
- test_double_sweep,
- test_each,
- test_empty?,
- test_from_session_value,
- test_from_session_value_on_json_serializer,
- test_keep_all_sweep,
- test_keep_sweep,
- test_key,
- test_keys,
- test_replace,
- test_replace_sweep,
- test_set_get,
- test_to_hash,
- test_to_session_value,
- test_update,
- test_update_delete_sweep,
- test_update_sweep
Instance Public methods
setup()
Link
test_clear_sweep()
Link
test_delete()
Link
test_delete_sweep()
Link
test_discard_no_args()
Link
test_discard_one_arg()
Link
test_discard_then_add()
Link
test_double_sweep()
Link
test_each()
Link
test_empty?()
Link
test_from_session_value()
Link
# File actionpack/test/controller/flash_hash_test.rb, line 72 def test_from_session_value # {"session_id"=>"f8e1b8152ba7609c28bbb17ec9263ba7", "flash"=>#<ActionDispatch::Flash::FlashHash:0x00000000000000 @used=#<Set: {"farewell"}>, @closed=false, @flashes={"greeting"=>"Hello", "farewell"=>"Goodbye"}, @now=nil>} rails_3_2_cookie = 'BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWY4ZTFiODE1MmJhNzYwOWMyOGJiYjE3ZWM5MjYzYmE3BjsAVEkiCmZsYXNoBjsARm86JUFjdGlvbkRpc3BhdGNoOjpGbGFzaDo6Rmxhc2hIYXNoCToKQHVzZWRvOghTZXQGOgpAaGFzaHsGSSINZmFyZXdlbGwGOwBUVDoMQGNsb3NlZEY6DUBmbGFzaGVzewdJIg1ncmVldGluZwY7AFRJIgpIZWxsbwY7AFRJIg1mYXJld2VsbAY7AFRJIgxHb29kYnllBjsAVDoJQG5vdzA=' session = Marshal.load(Base64.decode64(rails_3_2_cookie)) hash = Flash::FlashHash.from_session_value(session['flash']) assert_equal({'greeting' => 'Hello'}, hash.to_hash) assert_equal(nil, hash.to_session_value) end
test_from_session_value_on_json_serializer()
Link
# File actionpack/test/controller/flash_hash_test.rb, line 81 def test_from_session_value_on_json_serializer decrypted_data = "{ \"session_id\":\"d98bdf6d129618fc2548c354c161cfb5\", \"flash\":{\"discard\":[\"farewell\"], \"flashes\":{\"greeting\":\"Hello\",\"farewell\":\"Goodbye\"}} }" session = ActionDispatch::Cookies::JsonSerializer.load(decrypted_data) hash = Flash::FlashHash.from_session_value(session['flash']) assert_equal({'greeting' => 'Hello'}, hash.to_hash) assert_equal(nil, hash.to_session_value) assert_equal "Hello", hash[:greeting] assert_equal "Hello", hash["greeting"] end
test_keep_all_sweep()
Link
test_keep_sweep()
Link
test_key()
Link
test_keys()
Link
test_replace()
Link
test_replace_sweep()
Link
test_set_get()
Link
test_to_hash()
Link
test_to_session_value()
Link
# File actionpack/test/controller/flash_hash_test.rb, line 58 def test_to_session_value @hash['foo'] = 'bar' assert_equal({ 'discard' => [], 'flashes' => { 'foo' => 'bar' } }, @hash.to_session_value) @hash.now['qux'] = 1 assert_equal({ 'flashes' => { 'foo' => 'bar' }, 'discard' => [] }, @hash.to_session_value) @hash.discard('foo') assert_equal(nil, @hash.to_session_value) @hash.sweep assert_equal(nil, @hash.to_session_value) end
test_update()
Link
test_update_delete_sweep()
Link