Sha256: d26ed8a956e0d4c5b2cf527d872863477af759df41026544f12929a911dec5ff

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 Bytes

Contents

require 'helper'

class TestDeviseAesEncryptable < Test::Unit::TestCase
  should "be accessible" do
    encryptor = :aes256
    assert ::Devise::Encryptors.const_get(encryptor.to_s.classify)
  end
  should "encrypt and decrypt a password" do
    plain_text  = "A super secret password"
    pepper      = "eaa15a1fb0b0707ba443f7ce52a5a0e345391ff83b9955342d2a8e1c755fcd868ba4fb3c156166e13c9d4080cf2b505b4a383adc553c9567d75e3585cbccff98"
    salt        = Devise::Encryptors::Aes256.salt(nil)
    cipher_text = Devise::Encryptors::Aes256.digest(plain_text, 0, salt, pepper)
    assert_equal plain_text, Devise::Encryptors::Aes256.decrypt(cipher_text, pepper)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise_aes_encryptable-0.2.3 test/test_devise_aes_encryptable.rb
devise_aes_encryptable-0.2.2 test/test_devise_aes_encryptable.rb