Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-06 18:09:39 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-06 18:09:39 +0300
commitd4806ad7dbd2d87ae09872709fef1aef35792e21 (patch)
tree91c7b62c3a493f3b922ed49e6d8d86d43e04a74c /vendor
parent3e9c050126b34ac4f44ab9f5e4b9ffb48b902c01 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'vendor')
-rw-r--r--vendor/gems/attr_encrypted/test/active_record_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/gems/attr_encrypted/test/active_record_test.rb b/vendor/gems/attr_encrypted/test/active_record_test.rb
index 133546b3ceb..4c903bc3cd8 100644
--- a/vendor/gems/attr_encrypted/test/active_record_test.rb
+++ b/vendor/gems/attr_encrypted/test/active_record_test.rb
@@ -80,6 +80,10 @@ class PersonWithProcMode < Person
attr_encrypted :credentials, key: SECRET_KEY, mode: Proc.new { :single_iv_and_salt }, insecure_mode: true
end
+class PersonWithInstanceAttribute < Person
+ attr_encrypted :age
+end
+
class Account < ActiveRecord::Base
ACCOUNT_ENCRYPTION_KEY = SecureRandom.urlsafe_base64(24)
attr_encrypted :password, key: :password_encryption_key
@@ -343,4 +347,22 @@ class ActiveRecordTest < Minitest::Test
refute_equal address.encrypted_zipcode, zipcode
assert_equal address.zipcode, zipcode
end
+
+ # See https://github.com/attr-encrypted/attr_encrypted/issues/332
+ def test_attribute_instance_methods_as_symbols_available_returns_false
+ assert_equal false, ActiveRecord::Base.__send__(:attribute_instance_methods_as_symbols_available?)
+ end
+
+ # See https://github.com/attr-encrypted/attr_encrypted/issues/332
+ def test_does_not_define_virtual_attributes
+ instance = Person.new
+
+ %w[
+ encrypted_age encrypted_age=
+ encrypted_age_iv encrypted_age_iv=
+ encrypted_age_salt encrypted_age_salt=
+ ].each do |method_name|
+ assert_equal false, instance.respond_to?(method_name), "should not define #{method_name}"
+ end
+ end
end