Sha256: 45d29c77ea79c05d4d0d100c3b3ec9d2e6aa651b3f7505efbfaab64642f8a8ff

Contents?: true

Size: 1.85 KB

Versions: 1

Compression:

Stored size: 1.85 KB

Contents

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

module ORMAdaptersTests
  module ActiveRecordAdapterTests
    module ActsAsAuthenticTests
      class ConfigTest < ActiveSupport::TestCase
        def test_first_column_to_exist
          assert_equal :login, User.first_column_to_exist(:login, :crypted_password)
          assert_equal nil, User.first_column_to_exist(nil, :unknown)
          assert_equal :login, User.first_column_to_exist(:unknown, :login)
        end
        
        def test_acts_as_authentic_config
          default_config = {
            :confirm_password_did_not_match_message => "did not match",
            :single_access_token_field => :single_access_token,
            :login_field_regex => /\A\w[\w\.\-_@ ]+\z/,
            :session_ids => [nil],
            :login_field_regex_failed_message => "use only letters, numbers, spaces, and .-_@ please.",
            :remember_token_field => :remember_token,
            :password_field => :password,
            :logged_in_timeout => 600,
            :password_salt_field => :password_salt,
            :password_reset_token_valid_for => 600,
            :password_reset_token_field => :password_reset_token,
            :login_field_type => :login,
            :crypto_provider => Authlogic::CryptoProviders::Sha512,
            :password_blank_message => "can not be blank",
            :crypted_password_field => :crypted_password,
            :session_class => "UserSession",
            :login_field => :login,
            :email_field => :email,
            :email_field_regex => /\A[\w\.%\+\-]+@(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|jobs|museum)\z/i,
            :email_field_regex_failed_message=>"should look like an email address."
          }
          assert_equal default_config, User.acts_as_authentic_config
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
authlogic-1.2.0 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/config_test.rb