From 5fd39c166a819449d1c8cbc7d7fbeccc59b2dcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Riveros?= Date: Sun, 20 Jan 2019 23:58:44 -0300 Subject: [PATCH] 16 to 32 lenght --- .../models/two_factor_authenticatable_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb b/spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb index 3a932d6..6fb4f50 100644 --- a/spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb +++ b/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