rails/activerecord/test/cases
maximerety d0f3b007b2
[Fix #48685] Make the encryptor agnostic of the type of data to decrypt
It is the role of the underlying serializer to accept or reject the data
to decrypt depending on its type. This behavior mirrors what is done at
encryption, where the serializer asserts that the input is an
ActiveRecord::Encryption::Message.

This change allows for a wider variety of custom serializers, but does
not change the behavior when using the default MessageSerializer class.
Indeed, the default message serializer will raise a TypeError when
invoking JSON.parse on any non-String input. This error will subsequently
be translated into an ActiveRecord::Encryption::Errors::Encoding error
by the encryptor, which does not change the current behavior at the
encryptor level.

A new test asserts that the default MessageSerializer is able to reject
unexpected data types on its own at decryption time, just as it does at
encryption time (test already present). The test also asserts that an
exception is translated into an ActiveRecord::Encryption::Error::Encoding
error at the encryptor level.
2024-01-05 13:05:15 -05:00
..
adapters Cleanup `defined?` usage 2024-01-05 15:05:35 +01:00
arel Arel/MySQL ordering `nulls_first` and `nulls_last` 2023-11-17 20:59:11 +00:00
assertions Fix a flaky test in `query_assertions_test.rb` (#50503) 2024-01-02 12:50:43 +01:00
associations Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
attribute_methods Define missing attribute methods from `method_missing` 2024-01-05 16:56:19 +01:00
coders Fix a Gem::Version Comparison 2023-05-06 17:08:44 -07:00
connection_adapters Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
database_configurations Change disjunction to conjunction in suggestion 2023-11-19 15:49:34 -06:00
encryption [Fix #48685] Make the encryptor agnostic of the type of data to decrypt 2024-01-05 13:05:15 -05:00
fixture_set Validate keys in the `_fixture` field 2021-06-15 14:10:59 +02:00
migration Remove all code to work with Ruby < 3.1 2024-01-03 19:02:31 +00:00
relation Remove all code to work with Ruby < 3.1 2024-01-03 19:02:31 +00:00
scoping Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
tasks Refactor lookup of connection adapters 2023-11-16 09:07:44 +01:00
type Enable Minitest/LiteralAsActualArgument 2023-09-13 10:09:32 +09:00
validations Pass validation_context to validates_associated 2024-01-02 11:22:35 -05:00
active_record_schema_test.rb Clear metadata tables in tests instead of droping 2023-01-11 02:56:49 +02:00
active_record_test.rb Delay Adapter#check_version to #configure_connection 2023-09-29 08:53:16 +02:00
adapter_prevent_writes_test.rb Update postgres naming to PostgreSQL 2023-10-10 13:44:20 +05:30
adapter_test.rb Prevent marking broken connections as verified 2023-11-06 11:23:37 -05:00
aggregations_test.rb Fix composed_of freezing and duplication 2022-11-25 17:36:12 +01:00
annotate_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
associations_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
asynchronous_queries_test.rb Fix async queries to work with query cache 2023-12-20 23:50:41 +02:00
attribute_methods_test.rb Define missing attribute methods from `method_missing` 2024-01-05 16:56:19 +01:00
attributes_test.rb Make the output of `ActiveRecord::Core#inspect` configurable. 2023-11-08 14:23:16 -05:00
autosave_association_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
base_prevent_writes_test.rb Add `explain` support for methods like `last`, `pluck` and `count` 2024-01-04 11:11:09 +01:00
base_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
batches_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
binary_test.rb Ensure binary-destined values have binary encoding during type cast 2023-05-29 18:21:20 +09:30
bind_parameter_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
boolean_test.rb
cache_key_test.rb Introduce adapter for Trilogy, a MySQL-compatible DB client 2023-04-17 11:49:07 -04:00
calculations_test.rb Merge pull request #50373 from fatkodima/improve-queries-assertions-matchers 2023-12-21 12:59:10 +01:00
callbacks_test.rb Remove `require "active_support/core_ext/symbol/starts_ends_with"` 2021-02-09 22:31:09 +09:00
clone_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
collection_cache_key_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
column_alias_test.rb Use `current_adapter?` over `ActiveRecord::Base.connection.adapter_name` in tests 2021-02-25 13:08:08 +09:00
column_definition_test.rb
comment_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
connection_management_test.rb Fix missed test changes for pool method deprecations 2022-09-12 13:05:55 -04:00
connection_pool_test.rb Merge pull request #50190 from jhawthorn/retry_checkout_after_reap 2023-12-08 17:10:08 -08:00
core_test.rb Make the output of `ActiveRecord::Core#inspect` configurable. 2023-11-08 14:23:16 -05:00
counter_cache_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
custom_locking_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
database_configurations_test.rb Refactor lookup of connection adapters 2023-11-16 09:07:44 +01:00
database_selector_test.rb Multi database: define `reading_request?` in resolver 2022-04-23 12:05:59 +10:00
database_statements_test.rb
date_test.rb
date_time_precision_test.rb Preserve timestamp when setting an `ActiveSupport::TimeWithZone` value to `timestamptz` attribute 2023-05-31 00:35:29 +03:00
date_time_test.rb Fix tests for validation of default_timezone 2021-10-14 18:11:08 +00:00
defaults_test.rb Support `RETURNING` clause for MariaDB 2023-10-30 21:08:49 +02:00
delegated_type_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
dirty_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
disconnected_test.rb Remove unnecessary setters of `use_transactional_tests` 2023-06-16 14:05:49 -04:00
dup_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
enum_test.rb Support non-column-backed attributes for enum 2023-10-24 12:03:59 -05:00
errors_test.rb
excluding_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
explain_subscriber_test.rb Fix ActiveRecord's explain for queries starting with comments 2022-02-07 00:47:33 +02:00
explain_test.rb Add `explain` support for methods like `last`, `pluck` and `count` 2024-01-04 11:11:09 +01:00
filter_attributes_test.rb Make the output of `ActiveRecord::Core#inspect` configurable. 2023-11-08 14:23:16 -05:00
finder_respond_to_test.rb Rename behaviour to behavior in test case names 2022-05-26 17:14:18 -04:00
finder_test.rb Fix `find_by` for finding by associations with composite primary keys 2023-12-21 23:39:11 +02:00
fixtures_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
forbidden_attributes_protection_test.rb
habtm_destroy_order_test.rb
helper.rb Refactor lookup of connection adapters 2023-11-16 09:07:44 +01:00
hot_compatibility_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
i18n_test.rb
inheritance_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
inherited_test.rb Fix usage of `self.inherited` 2023-11-10 22:55:37 +01:00
insert_all_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
instrumentation_test.rb Stop building AS::Notifications::Event manually 2023-09-29 12:34:23 -04:00
integration_test.rb Revert "Merge pull request #49242 from eileencodes/fix-inferred-query-constraints" 2023-09-12 22:36:33 +00:00
invalid_connection_test.rb Delay Adapter#check_version to #configure_connection 2023-09-29 08:53:16 +02:00
invertible_migration_test.rb Introduce adapter for Trilogy, a MySQL-compatible DB client 2023-04-17 11:49:07 -04:00
json_attribute_test.rb Delete incompatible Trilogy tests 2023-04-24 09:35:28 +02:00
json_serialization_test.rb Avoid extra pass on AS::JSON.dump with no options 2023-06-29 15:37:57 -07:00
json_shared_test_cases.rb Allow to define the default column serializer 2023-02-22 19:32:28 +01:00
locking_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
log_subscriber_test.rb Optimize ActiveRecord::LogSubscriber#query_source_location 2023-08-31 11:56:55 +02:00
marshal_serialization_test.rb Implement `marshal_dump` and `marshal_load` on ActiveRecord::Base 2023-03-28 16:46:14 +02:00
message_pack_test.rb Load `author_addresses` fixtures for `ActiveRecordMessagePackTest` 2023-10-11 22:57:39 +03:00
migration_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
migrator_test.rb Remove unnecessary setters of `use_transactional_tests` 2023-06-16 14:05:49 -04:00
mixin_test.rb
modules_test.rb Module#const_set is a public method 2020-09-15 17:19:37 +09:00
multi_db_migrator_test.rb Remove unnecessary setters of `use_transactional_tests` 2023-06-16 14:05:49 -04:00
multiparameter_attributes_test.rb Make #to_fs the default replacement for #to_s(:format) 2022-02-07 12:41:21 +01:00
multiple_db_test.rb Store connection_pool in DB exceptions 2023-06-02 10:44:28 -04:00
nested_attributes_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
nested_attributes_with_callbacks_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
normalized_attribute_test.rb Add negative `where` examples for `normalizes` 2023-09-10 16:40:29 -05:00
null_relation_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
numeric_data_test.rb
persistence_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
pooled_connections_test.rb AR adapter helpers are now available only within AR::TestCase class 2023-01-01 21:43:24 +09:00
prepared_statement_status_test.rb Fix test failure if `prepared_statements` is flipped 2020-01-03 18:51:15 +09:00
primary_class_test.rb Remove unnecessary setters of `use_transactional_tests` 2023-06-16 14:05:49 -04:00
primary_keys_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
query_cache_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
query_logs_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
quoting_test.rb Introduce adapter for Trilogy, a MySQL-compatible DB client 2023-04-17 11:49:07 -04:00
readonly_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
reaper_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
reflection_test.rb Raise on `foreign_key:` being passed as an array in associations 2023-10-13 17:10:07 +00:00
relation_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
relations_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
reload_models_test.rb AR adapter helpers are now available only within AR::TestCase class 2023-01-01 21:43:24 +09:00
reserved_word_test.rb
result_test.rb Remove deprecated `ActiveRecord::Result#map!` and `ActiveRecord::Result#collect!` 2021-11-19 23:16:25 +00:00
sanitize_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
schema_dumper_test.rb Use cannonical form of library names 2023-10-30 12:51:35 -05:00
schema_loading_test.rb
secure_password_test.rb Retry flaky secure password test 2023-03-12 23:24:28 +02:00
secure_token_test.rb [Fix #49874] `has_secure_token` calls the setter method on initialize 2023-12-03 14:35:19 +04:00
serialization_test.rb Change ActiveRecord::Coders::YAMLColumn default to safe_load 2022-07-12 09:26:46 -07:00
serialized_attribute_test.rb Fix HomogeneousIn for serialized attributes 2023-11-09 15:26:13 -06:00
shard_selector_test.rb Add automatic shard swapping middleware 2021-11-18 08:18:45 -05:00
signed_id_test.rb Ensure `#signed_id` outputs `url_safe` strings (#49507) 2023-10-06 15:24:37 +02:00
statement_cache_test.rb Raise when defining an enum not backed by a database column 2022-08-03 11:14:45 +03:00
statement_invalid_test.rb Separate two groups of retryable DB exceptions 2022-07-26 22:07:35 +09:30
store_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
strict_loading_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
suppressor_test.rb
test_case.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
test_databases_test.rb Rename 'db' to 'test/db' in Active Record's tests 2020-03-03 13:31:12 +00:00
test_fixtures_test.rb Run a load hook when TestFixtures is included 2023-03-17 13:36:48 -04:00
time_precision_test.rb Introduce adapter for Trilogy, a MySQL-compatible DB client 2023-04-17 11:49:07 -04:00
timestamp_test.rb [Fix #45389] updated_at not updating in before_update callback 2023-03-26 17:52:12 +10:00
token_for_test.rb Fix flaky test in AR - token for 2023-04-28 16:40:00 +05:30
touch_later_test.rb Hide changes to before_committed! behaviour behind config 2022-12-15 11:43:51 -05:00
transaction_callbacks_test.rb fix after_commit callback when record is destroyed twice 2023-05-25 14:58:02 -07:00
transaction_instrumentation_test.rb Ensure transaction tracking finishes when reconnecting 2023-10-04 19:35:22 -04:00
transaction_isolation_test.rb AR adapter helpers are now available only within AR::TestCase class 2023-01-01 21:43:24 +09:00
transactions_test.rb Expose `assert_queries_match` and `assert_no_queries_match` assertions 2023-12-21 01:30:16 +02:00
type_test.rb `attribute` should not require a connection is established 2021-02-02 15:04:23 +09:00
types_test.rb
unconnected_test.rb Ensure connection_name is used everywhere 2022-07-11 13:44:57 -04:00
unsafe_raw_sql_test.rb Introduce adapter for Trilogy, a MySQL-compatible DB client 2023-04-17 11:49:07 -04:00
validations_repair_helper.rb
validations_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
view_test.rb Introduce adapter for Trilogy, a MySQL-compatible DB client 2023-04-17 11:49:07 -04:00
yaml_serialization_test.rb [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00