Sha256: 44b38994792b98e4e059385a1bf8a2c4eaf474805faabe5b3ca675d44eeb2bf8

Contents?: true

Size: 753 Bytes

Versions: 3

Compression:

Stored size: 753 Bytes

Contents

require "test_helper"

module CryptoProviderTest
  class Sha1Test < ActiveSupport::TestCase
    def test_encrypt
      assert Authlogic::CryptoProviders::Sha1.encrypt("mypass")
    end

    def test_matches
      hash = Authlogic::CryptoProviders::Sha1.encrypt("mypass")
      assert Authlogic::CryptoProviders::Sha1.matches?(hash, "mypass")
    end

    def test_old_restful_authentication_passwords
      password = "test"
      salt = "7e3041ebc2fc05a40c60028e2c4901a81035d3cd"
      digest = "00742970dc9e6319f8019fd54864d3ea740f04b1"
      Authlogic::CryptoProviders::Sha1.stretches = 1
      assert Authlogic::CryptoProviders::Sha1.matches?(digest, nil, salt, password, nil)
      Authlogic::CryptoProviders::Sha1.stretches = 10
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authlogic-4.2.0 test/crypto_provider_test/sha1_test.rb
authlogic-4.1.1 test/crypto_provider_test/sha1_test.rb
authlogic-4.1.0 test/crypto_provider_test/sha1_test.rb