Sha256: 4fb3e6a312156457e065fb9b30e0eaa838beac80fc2cc9b871333ab68f9047df

Contents?: true

Size: 1.49 KB

Versions: 24

Compression:

Stored size: 1.49 KB

Contents

require 'test_helper'

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

24 entries across 24 versions & 9 rubygems

Version Path
authlogic-3.4.3 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.4.2 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.4.1 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.4.0 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.3.0 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.2.0 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.1.3 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.1.2 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.1.1 test/acts_as_authentic_test/restful_authentication_test.rb
nulogy-authlogic-3.1.0.1 test/acts_as_authentic_test/restful_authentication_test.rb
Empact-authlogic-3.1.0 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.1.0 test/acts_as_authentic_test/restful_authentication_test.rb
Empact-authlogic-3.0.3 test/acts_as_authentic_test/restful_authentication_test.rb
antlypls-authlogic-3.0.3 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.0.3 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.0.2 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.0.1 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-3.0.0 test/acts_as_authentic_test/restful_authentication_test.rb
authlogic-rails3-2.2 test/acts_as_authentic_test/restful_authentication_test.rb
kb-authlogic-2.1.7 test/acts_as_authentic_test/restful_authentication_test.rb