Browse Source

16 to 32 lenght

master
Andrés Riveros 6 years ago
parent
commit
5fd39c166a
  1. 10
      spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb

10
spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb

@ -138,12 +138,12 @@ describe Devise::Models::TwoFactorAuthenticatable do
it "returns uri with user's email" do
expect(instance.provisioning_uri).
to match(%r{otpauth://totp/houdini@example.com\?secret=\w{16}})
to match(%r{otpauth://totp/houdini@example.com\?secret=\w{32}})
end
it 'returns uri with issuer option' do
expect(instance.provisioning_uri('houdini')).
to match(%r{otpauth://totp/houdini\?secret=\w{16}$})
to match(%r{otpauth://totp/houdini\?secret=\w{32}$})
end
it 'returns uri with issuer option' do
@ -155,7 +155,7 @@ describe Devise::Models::TwoFactorAuthenticatable do
expect(uri.host).to eq('totp')
expect(uri.path).to eq('/Magic:houdini')
expect(params['issuer'].shift).to eq('Magic')
expect(params['secret'].shift).to match(/\w{16}/)
expect(params['secret'].shift).to match(/\w{32}/)
end
end
end
@ -168,10 +168,10 @@ describe Devise::Models::TwoFactorAuthenticatable do
shared_examples 'generate_totp_secret' do |klass|
let(:instance) { klass.new }
it 'returns a 16 character string' do
it 'returns a 32 character string' do
secret = instance.generate_totp_secret
expect(secret).to match(/\w{16}/)
expect(secret).to match(/\w{32}/)
end
end

Loading…
Cancel
Save