diff --git a/devise-two-factor.gemspec b/devise-two-factor.gemspec index f3562a7..45caac0 100644 --- a/devise-two-factor.gemspec +++ b/devise-two-factor.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'railties' s.add_runtime_dependency 'activesupport' - s.add_runtime_dependency 'attr_encrypted', '>= 1.3', '< 4', '!= 2' + s.add_runtime_dependency 'attr_encrypted', '>= 1.3', '< 2', '!= 2' s.add_runtime_dependency 'devise', '~> 4.0' s.add_runtime_dependency 'rotp', '~> 3.0' diff --git a/spec/devise/models/two_factor_authenticatable_spec.rb b/spec/devise/models/two_factor_authenticatable_spec.rb index 119e1ef..a4294ff 100644 --- a/spec/devise/models/two_factor_authenticatable_spec.rb +++ b/spec/devise/models/two_factor_authenticatable_spec.rb @@ -66,15 +66,15 @@ def save(validate) describe 'otp_secret options' do it 'should be of the key' do - expect(subject.encrypted_attributes[:otp_secret][:key]).to eq('test-key'*8) + expect(subject.evaluated_attr_encrypted_options_for(:otp_secret)[:key]).to eq('test-key'*8) end it 'should be of the mode' do - expect(subject.encrypted_attributes[:otp_secret][:mode]).to eq(:per_attribute_iv_and_salt) + expect(subject.evaluated_attr_encrypted_options_for(:otp_secret)[:mode]).to eq(:per_attribute_iv_and_salt) end it 'should be of the mode' do - expect(subject.encrypted_attributes[:otp_secret][:algorithm]).to eq('aes-256-cbc') + expect(subject.evaluated_attr_encrypted_options_for(:otp_secret)[:algorithm]).to eq('aes-256-cbc') end end end