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 rails_3_2_cookie = 'BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWY4ZTFiODE1MmJhNzYwOWMyOGJiYjE3ZWM5MjYzYmE3BjsAVEkiCmZsYXNoBjsARm86JUFjdGlvbkRpc3BhdGNoOjpGbGFzaDo6Rmxhc2hIYXNoCToKQHVzZWRvOghTZXQGOgpAaGFzaHsAOgxAY2xvc2VkRjoNQGZsYXNoZXN7BkkiDG1lc3NhZ2UGOwBGSSIKSGVsbG8GOwBGOglAbm93MA==' session = Marshal.load(Base64.decode64(rails_3_2_cookie)) hash = Flash::FlashHash.from_session_value(session['flash']) assert_equal({'flashes' => {'message' => 'Hello'}, 'discard' => %w[message]}, hash.to_session_value) end
test_from_session_value_on_json_serializer()
Link
# File actionpack/test/controller/flash_hash_test.rb, line 79 def test_from_session_value_on_json_serializer decrypted_data = "{ \"session_id\":\"d98bdf6d129618fc2548c354c161cfb5\", \"flash\":{\"discard\":[], \"flashes\":{\"message\":\"hey you\"}} }" session = ActionDispatch::Cookies::JsonSerializer.load(decrypted_data) hash = Flash::FlashHash.from_session_value(session['flash']) assert_equal({'discard' => %w[message], 'flashes' => { 'message' => 'hey you'}}, hash.to_session_value) assert_equal "hey you", hash[:message] assert_equal "hey you", hash["message"] 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({'flashes' => {'foo' => 'bar'}, 'discard' => []}, @hash.to_session_value) @hash.discard('foo') assert_equal({'flashes' => {'foo' => 'bar'}, 'discard' => %w[foo]}, @hash.to_session_value) @hash.now['qux'] = 1 assert_equal({'flashes' => {'foo' => 'bar', 'qux' => 1}, 'discard' => %w[foo qux]}, @hash.to_session_value) @hash.sweep assert_equal(nil, @hash.to_session_value) end
test_update()
Link
test_update_delete_sweep()
Link