Sha256: 30d4aa350e9718f3c55adfd8855a35b87751dcf29f3be6502604178c66359b14
Contents?: true
Size: 940 Bytes
Versions: 9
Compression:
Stored size: 940 Bytes
Contents
require 'abstract_unit' require 'fixtures/user' class SymmetricSentryCallbackTest < ActiveSupport::TestCase #fixtures :users # def setup super @str = 'sentry' Sentry::SymmetricSentry.default_key = @key = 'secret' @encrypted = "0XlmUuNpE2k=\n" end def test_foo assert true end # #def test_should_encrypt_user_password # u = SymmetricUser.new :login => 'bob' # u.password = @str # assert u.save # assert_equal @encrypted, u.crypted_password #end # #def test_should_decrypted_user_password # assert_equal @str, users(:user_1).password #end # #def test_should_return_nil_on_invalid_key # Sentry::SymmetricSentry.default_key = 'other secret' # assert_nil users(:user_1).password #end # #def test_should_raise_error_on_invalid_key # Sentry::SymmetricSentry.default_key = 'other secret' # assert_raises(OpenSSL::CipherError) { users(:user_1).password! } #end end
Version data entries
9 entries across 9 versions & 5 rubygems