Sha256: ab37fc7fde0cb52e84441086ecda5ec9e31cbb500fe05024bfb32a44cd7d0fba

Contents?: true

Size: 1.51 KB

Versions: 14

Compression:

Stored size: 1.51 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

14 entries across 14 versions & 1 rubygems

Version Path
refinerycms-0.9.6.34 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.33 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.32 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.31 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.30 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.29 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.28 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.27 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.26 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.25 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.24 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.23 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.22 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb
refinerycms-0.9.6.21 vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb