mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 23:08:05 -05:00
Implement Devise::Models::Authenticatable#inspect, re-using #serializable_hash.
This commit is contained in:
@@ -35,6 +35,11 @@ class SerializableTest < ActiveSupport::TestCase
|
||||
assert_key "confirmation_token", from_json(force_except: :email)
|
||||
end
|
||||
|
||||
test 'should not include unsafe keys in inspect' do
|
||||
assert_match(/email/, @user.inspect)
|
||||
assert_no_match(/confirmation_token/, @user.inspect)
|
||||
end
|
||||
|
||||
def assert_key(key, subject)
|
||||
assert subject.key?(key), "Expected #{subject.inspect} to have key #{key.inspect}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user