Namespace
- CLASS CookiesTest::CustomSerializer
- CLASS CookiesTest::JSONWrapper
- CLASS CookiesTest::TestController
Methods
- S
- T
-
- test_accessing_nonexistant_encrypted_cookie_should_not_raise_invalid_message,
- test_accessing_nonexistant_signed_cookie_should_not_raise_an_invalid_signature,
- test_can_set_http_cookie_header,
- test_can_set_request_cookies,
- test_cookie_with_all_domain_option,
- test_cookie_with_all_domain_option_and_tld_length,
- test_cookie_with_all_domain_option_using_a_non_standard_tld,
- test_cookie_with_all_domain_option_using_a_non_standard_tld_and_tld_length,
- test_cookie_with_all_domain_option_using_australian_style_tld,
- test_cookie_with_all_domain_option_using_host_with_port,
- test_cookie_with_all_domain_option_using_host_with_port_and_tld_length,
- test_cookie_with_all_domain_option_using_ipv4_address,
- test_cookie_with_all_domain_option_using_ipv6_address,
- test_cookie_with_all_domain_option_using_localhost,
- test_cookie_with_all_domain_option_using_uk_style_tld,
- test_cookie_with_several_preset_domains_using_one_of_these_domains,
- test_cookie_with_several_preset_domains_using_other_domain,
- test_cookie_with_several_preset_domains_using_shared_domain,
- test_cookies_can_be_cleared,
- test_cookies_hash_is_indifferent_access,
- test_cookies_persist_throughout_request,
- test_cookies_precedence_over_http_cookie,
- test_cookies_precedence_over_request_cookies,
- test_cookies_retained_across_requests,
- test_delete_and_set_cookie,
- test_delete_cookie_with_path,
- test_delete_unexisting_cookie,
- test_deleted_cookie_predicate,
- test_deleted_cookie_predicate_with_mismatching_options,
- test_deleting_cookie_with_all_domain_option,
- test_deleting_cookie_with_all_domain_option_and_tld_length,
- test_deletings_cookie_with_several_preset_domains_using_one_of_these_domains,
- test_deletings_cookie_with_several_preset_domains_using_other_domain,
- test_each,
- test_encrypted_cookie_using_custom_digest,
- test_encrypted_cookie_using_custom_serializer,
- test_encrypted_cookie_using_default_serializer,
- test_encrypted_cookie_using_hybrid_serializer_can_migrate_marshal_dumped_value_to_json,
- test_encrypted_cookie_using_hybrid_serializer_can_read_from_json_dumped_value,
- test_encrypted_cookie_using_json_serializer,
- test_encrypted_cookie_using_marshal_serializer,
- test_encrypted_uses_encrypted_cookie_jar_if_only_secret_key_base_is_set,
- test_encrypted_uses_upgrade_legacy_encrypted_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_enumerable,
- test_expiring_cookie,
- test_fetch,
- test_fetch_block,
- test_fetch_exists,
- test_fetch_type_error,
- test_key_is_to_s,
- test_key_methods,
- test_legacy_json_signed_cookie_is_read_and_transparently_encrypted_by_encrypted_hybrid_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_legacy_json_signed_cookie_is_read_and_transparently_encrypted_by_encrypted_json_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_legacy_json_signed_cookie_is_read_and_transparently_upgraded_by_signed_json_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_legacy_json_signed_cookie_is_read_and_transparently_upgraded_by_signed_json_hybrid_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_legacy_marshal_signed_cookie_is_read_and_transparently_encrypted_by_encrypted_hybrid_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_legacy_marshal_signed_cookie_is_read_and_transparently_upgraded_by_signed_json_hybrid_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_legacy_signed_cookie_is_read_and_transparently_encrypted_by_encrypted_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_legacy_signed_cookie_is_read_and_transparently_upgraded_by_signed_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_legacy_signed_cookie_is_treated_as_nil_by_encrypted_cookie_jar_if_tampered,
- test_legacy_signed_cookie_is_treated_as_nil_by_signed_cookie_jar_if_tampered,
- test_multiple_cookies,
- test_not_setting_cookie_with_secure,
- test_permanent_signed_cookie,
- test_raise_data_overflow,
- test_raises_argument_error_if_missing_secret,
- test_raises_argument_error_if_secret_is_probably_insecure,
- test_read_permanent_cookie,
- test_set_permanent_cookie,
- test_setting_cookie,
- test_setting_cookie_for_fourteen_days,
- test_setting_cookie_for_fourteen_days_with_symbols,
- test_setting_cookie_with_http_only,
- test_setting_cookie_with_secure,
- test_setting_cookie_with_secure_when_always_write_cookie_is_true,
- test_setting_invalid_encrypted_cookie_should_return_nil_when_accessing_it,
- test_setting_request_cookies_is_indifferent_access,
- test_setting_test_cookie,
- test_setting_the_same_value_to_cookie,
- test_setting_the_same_value_to_permanent_cookie,
- test_setting_with_escapable_characters,
- test_signed_cookie_using_custom_digest,
- test_signed_cookie_using_custom_serializer,
- test_signed_cookie_using_default_digest,
- test_signed_cookie_using_default_serializer,
- test_signed_cookie_using_hybrid_serializer_can_migrate_marshal_dumped_value_to_json,
- test_signed_cookie_using_hybrid_serializer_can_read_from_json_dumped_value,
- test_signed_cookie_using_json_serializer,
- test_signed_cookie_using_marshal_serializer,
- test_signed_or_encrypted_uses_encrypted_cookie_jar_if_only_secret_key_base_is_set,
- test_signed_or_encrypted_uses_signed_cookie_jar_if_only_secret_token_is_set,
- test_signed_or_encrypted_uses_upgrade_legacy_encrypted_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_signed_uses_signed_cookie_jar_if_only_secret_key_base_is_set,
- test_signed_uses_signed_cookie_jar_if_only_secret_token_is_set,
- test_signed_uses_upgrade_legacy_signed_cookie_jar_if_both_secret_token_and_secret_key_base_are_set,
- test_tampered_cookies,
- test_wrapped_encrypted_cookie_using_json_serializer,
- test_wrapped_signed_cookie_using_json_serializer
Instance Public methods
setup()
Link
# File actionpack/test/dispatch/cookies_test.rb, line 207 def setup super @request.env["action_dispatch.key_generator"] = ActiveSupport::KeyGenerator.new("b3c631c314c0bbca50c1b2843150fe33", iterations: 2) @request.env["action_dispatch.signed_cookie_salt"] = "b3c631c314c0bbca50c1b2843150fe33" @request.env["action_dispatch.encrypted_cookie_salt"] = "b3c631c314c0bbca50c1b2843150fe33" @request.env["action_dispatch.encrypted_signed_cookie_salt"] = "b3c631c314c0bbca50c1b2843150fe33" @request.host = "www.nextangle.com" end
test_accessing_nonexistant_encrypted_cookie_should_not_raise_invalid_message()
Link
test_accessing_nonexistant_signed_cookie_should_not_raise_an_invalid_signature()
Link
test_cookie_with_all_domain_option_using_a_non_standard_tld_and_tld_length()
Link
test_cookie_with_all_domain_option_using_host_with_port_and_tld_length()
Link
test_deletings_cookie_with_several_preset_domains_using_one_of_these_domains()
Link
test_deletings_cookie_with_several_preset_domains_using_other_domain()
Link
test_each()
Link
test_encrypted_cookie_using_hybrid_serializer_can_migrate_marshal_dumped_value_to_json()
Link
test_encrypted_cookie_using_hybrid_serializer_can_read_from_json_dumped_value()
Link
test_encrypted_uses_encrypted_cookie_jar_if_only_secret_key_base_is_set()
Link
test_encrypted_uses_upgrade_legacy_encrypted_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_enumerable()
Link
test_fetch()
Link
test_fetch_block()
Link
test_fetch_exists()
Link
test_fetch_type_error()
Link
test_key_is_to_s()
Link
test_key_methods()
Link
test_legacy_json_signed_cookie_is_read_and_transparently_encrypted_by_encrypted_hybrid_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_legacy_json_signed_cookie_is_read_and_transparently_encrypted_by_encrypted_json_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_legacy_json_signed_cookie_is_read_and_transparently_upgraded_by_signed_json_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_legacy_json_signed_cookie_is_read_and_transparently_upgraded_by_signed_json_hybrid_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_legacy_marshal_signed_cookie_is_read_and_transparently_encrypted_by_encrypted_hybrid_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_legacy_marshal_signed_cookie_is_read_and_transparently_upgraded_by_signed_json_hybrid_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_legacy_signed_cookie_is_read_and_transparently_encrypted_by_encrypted_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_legacy_signed_cookie_is_read_and_transparently_upgraded_by_signed_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_legacy_signed_cookie_is_treated_as_nil_by_encrypted_cookie_jar_if_tampered()
Link
test_legacy_signed_cookie_is_treated_as_nil_by_signed_cookie_jar_if_tampered()
Link
test_raise_data_overflow()
Link
test_raises_argument_error_if_missing_secret()
Link
# File actionpack/test/dispatch/cookies_test.rb, line 651 def test_raises_argument_error_if_missing_secret assert_raise(ArgumentError, nil.inspect) { @request.env["action_dispatch.key_generator"] = ActiveSupport::LegacyKeyGenerator.new(nil) get :set_signed_cookie } assert_raise(ArgumentError, ''.inspect) { @request.env["action_dispatch.key_generator"] = ActiveSupport::LegacyKeyGenerator.new("") get :set_signed_cookie } end
test_raises_argument_error_if_secret_is_probably_insecure()
Link
# File actionpack/test/dispatch/cookies_test.rb, line 663 def test_raises_argument_error_if_secret_is_probably_insecure assert_raise(ArgumentError, "password".inspect) { @request.env["action_dispatch.key_generator"] = ActiveSupport::LegacyKeyGenerator.new("password") get :set_signed_cookie } assert_raise(ArgumentError, "secret".inspect) { @request.env["action_dispatch.key_generator"] = ActiveSupport::LegacyKeyGenerator.new("secret") get :set_signed_cookie } assert_raise(ArgumentError, "12345678901234567890123456789".inspect) { @request.env["action_dispatch.key_generator"] = ActiveSupport::LegacyKeyGenerator.new("12345678901234567890123456789") get :set_signed_cookie } end
test_setting_invalid_encrypted_cookie_should_return_nil_when_accessing_it()
Link
test_setting_with_escapable_characters()
Link
# File actionpack/test/dispatch/cookies_test.rb, line 289 def test_setting_with_escapable_characters get :set_with_with_escapable_characters assert_cookie_header "that+%26+guy=foo+%26+bar+%3D%3E+baz; path=/" assert_equal({"that & guy" => "foo & bar => baz"}, @response.cookies) end
test_signed_cookie_using_hybrid_serializer_can_migrate_marshal_dumped_value_to_json()
Link
test_signed_cookie_using_hybrid_serializer_can_read_from_json_dumped_value()
Link
test_signed_or_encrypted_uses_encrypted_cookie_jar_if_only_secret_key_base_is_set()
Link
test_signed_or_encrypted_uses_signed_cookie_jar_if_only_secret_token_is_set()
Link
test_signed_or_encrypted_uses_upgrade_legacy_encrypted_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link
test_signed_uses_upgrade_legacy_signed_cookie_jar_if_both_secret_token_and_secret_key_base_are_set()
Link