0
0
Fork 0

Extract SIGN_COUNT_LIMIT constant in WebauthnCredential class (#30636)

This commit is contained in:
Matt Jankowski 2024-06-11 11:36:21 -04:00 committed by GitHub
parent 921b0db544
commit d818ddd687
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -71,8 +71,8 @@ RSpec.describe WebauthnCredential do
expect(webauthn_credential).to model_have_error_on_field(:sign_count)
end
it 'is invalid if sign_count is greater 2**63 - 1' do
webauthn_credential = Fabricate.build(:webauthn_credential, sign_count: 2**63)
it 'is invalid if sign_count is greater than the limit' do
webauthn_credential = Fabricate.build(:webauthn_credential, sign_count: (described_class::SIGN_COUNT_LIMIT * 2))
webauthn_credential.valid?