Sha256: 161a139eb0a0dd61fa2c416c6ecf0d23fdd22d154d09543554897202b395d333

Contents?: true

Size: 1.52 KB

Versions: 47

Compression:

Stored size: 1.52 KB

Contents

require File.dirname(__FILE__) + '/../test_helper.rb'

module ActsAsAuthenticTest
  class RestfulAuthenticationTest < ActiveSupport::TestCase
    def test_act_like_restful_authentication_config
      assert !User.act_like_restful_authentication
      assert !Employee.act_like_restful_authentication
  
      User.act_like_restful_authentication = true
      assert User.act_like_restful_authentication
      assert_equal Authlogic::CryptoProviders::Sha1, User.crypto_provider
      assert defined?(::REST_AUTH_SITE_KEY)
      assert_equal '', ::REST_AUTH_SITE_KEY
      assert_equal 1, Authlogic::CryptoProviders::Sha1.stretches

      User.act_like_restful_authentication false
      assert !User.act_like_restful_authentication
  
      User.crypto_provider = Authlogic::CryptoProviders::Sha512
      User.transition_from_crypto_providers = []
    end

    def test_transition_from_restful_authentication_config
      assert !User.transition_from_restful_authentication
      assert !Employee.transition_from_restful_authentication
      
      User.transition_from_restful_authentication = true
      assert User.transition_from_restful_authentication
      assert defined?(::REST_AUTH_SITE_KEY)
      assert_equal '', ::REST_AUTH_SITE_KEY
      assert_equal 1, Authlogic::CryptoProviders::Sha1.stretches
  
      User.transition_from_restful_authentication false
      assert !User.transition_from_restful_authentication
  
      User.crypto_provider = Authlogic::CryptoProviders::Sha512
      User.transition_from_crypto_providers = []
    end
  end
end

Version data entries

47 entries across 47 versions & 15 rubygems

Version Path
authlogic-2.1.11 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-2.1.10 test/acts_as_authentic_test/restful_authentication_test.rb
binarylogic-authlogic-2.1.0 test/acts_as_authentic_test/restful_authentication_test.rb
binarylogic-authlogic-2.1.1 test/acts_as_authentic_test/restful_authentication_test.rb
crankharder-authlogic-2.1.1 test/acts_as_authentic_test/restful_authentication_test.rb
jlecour-authlogic-2.1.2 test/acts_as_authentic_test/restful_authentication_test.rb
kschrader-authlogic-2.1.2 test/acts_as_authentic_test/restful_authentication_test.rb
kschrader-authlogic-2.1.3 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-2.1.8 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-2.1.7 test/acts_as_authentic_test/restful_authentication_test.rb
expertiza-authlogic-2.1.6.1 test/acts_as_authentic_test/restful_authentication_test.rb
wulffeld_authlogic-2.1.3 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-2.1.6 test/acts_as_authentic_test/restful_authentication_test.rb
lockbox_middleware-1.2.1 vendor/gems/authlogic-2.1.3/test/acts_as_authentic_test/restful_authentication_test.rb
Empact-authlogic-2.1.5 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-2.1.5 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-2.1.4 test/acts_as_authentic_test/restful_authentication_test.rb
Empact-authlogic-2.1.4 test/acts_as_authentic_test/restful_authentication_test.rb
namxam-authlogic-2.1.3.1 test/acts_as_authentic_test/restful_authentication_test.rb
drogus-authlogic-2.1.3 test/acts_as_authentic_test/restful_authentication_test.rb