From ad4d4456320fd4419534e719f068c0d53faa46da Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 23 Oct 2024 17:07:00 -0700 Subject: [PATCH] Improved test --- test/model_test.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/model_test.rb b/test/model_test.rb index ad40549..005e299 100644 --- a/test/model_test.rb +++ b/test/model_test.rb @@ -220,13 +220,17 @@ def test_attributes_not_loaded skip if mongoid? User.create!(email: "test@example.org") - user = User.select("id").last + user = User.select("id", "phone_ciphertext").last assert_nil user.attributes["email"] assert !user.has_attribute?("name") assert !user.has_attribute?(:name) - assert_equal ["id"], user.attributes.keys - assert_equal ["id"], user.attribute_names + assert_equal ["id", "phone_ciphertext", "phone"], user.attributes.keys + assert_equal ["id", "phone_ciphertext", "phone"], user.attribute_names + assert user.has_attribute?("phone_ciphertext") + assert user.has_attribute?(:phone_ciphertext) + assert user.has_attribute?("phone") + assert user.has_attribute?(:phone) assert !user.has_attribute?("email") assert !user.has_attribute?(:email)