authlogic 3.4.6 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE.md +13 -0
- data/.github/triage.md +87 -0
- data/.gitignore +4 -0
- data/.rubocop.yml +127 -0
- data/.rubocop_todo.yml +65 -0
- data/.travis.yml +18 -10
- data/CHANGELOG.md +156 -6
- data/CONTRIBUTING.md +71 -3
- data/Gemfile +2 -2
- data/README.md +386 -0
- data/Rakefile +13 -7
- data/UPGRADING.md +22 -0
- data/authlogic.gemspec +33 -22
- data/lib/authlogic.rb +60 -52
- data/lib/authlogic/acts_as_authentic/base.rb +40 -26
- data/lib/authlogic/acts_as_authentic/email.rb +96 -32
- data/lib/authlogic/acts_as_authentic/logged_in_status.rb +36 -12
- data/lib/authlogic/acts_as_authentic/login.rb +114 -49
- data/lib/authlogic/acts_as_authentic/magic_columns.rb +17 -6
- data/lib/authlogic/acts_as_authentic/password.rb +296 -139
- data/lib/authlogic/acts_as_authentic/perishable_token.rb +34 -20
- data/lib/authlogic/acts_as_authentic/persistence_token.rb +20 -24
- data/lib/authlogic/acts_as_authentic/queries/find_with_case.rb +67 -0
- data/lib/authlogic/acts_as_authentic/restful_authentication.rb +68 -23
- data/lib/authlogic/acts_as_authentic/session_maintenance.rb +128 -85
- data/lib/authlogic/acts_as_authentic/single_access_token.rb +41 -25
- data/lib/authlogic/acts_as_authentic/validations_scope.rb +8 -8
- data/lib/authlogic/authenticates_many/association.rb +22 -14
- data/lib/authlogic/authenticates_many/base.rb +35 -16
- data/lib/authlogic/config.rb +10 -10
- data/lib/authlogic/controller_adapters/abstract_adapter.rb +40 -12
- data/lib/authlogic/controller_adapters/rack_adapter.rb +15 -8
- data/lib/authlogic/controller_adapters/rails_adapter.rb +42 -22
- data/lib/authlogic/controller_adapters/sinatra_adapter.rb +3 -3
- data/lib/authlogic/crypto_providers.rb +91 -0
- data/lib/authlogic/crypto_providers/aes256.rb +42 -14
- data/lib/authlogic/crypto_providers/bcrypt.rb +35 -20
- data/lib/authlogic/crypto_providers/md5.rb +11 -9
- data/lib/authlogic/crypto_providers/scrypt.rb +26 -13
- data/lib/authlogic/crypto_providers/sha1.rb +14 -8
- data/lib/authlogic/crypto_providers/sha256.rb +16 -12
- data/lib/authlogic/crypto_providers/sha512.rb +8 -24
- data/lib/authlogic/crypto_providers/wordpress.rb +44 -15
- data/lib/authlogic/i18n.rb +33 -20
- data/lib/authlogic/i18n/translator.rb +1 -1
- data/lib/authlogic/random.rb +12 -29
- data/lib/authlogic/regex.rb +59 -27
- data/lib/authlogic/session/activation.rb +36 -23
- data/lib/authlogic/session/active_record_trickery.rb +13 -10
- data/lib/authlogic/session/base.rb +20 -8
- data/lib/authlogic/session/brute_force_protection.rb +87 -56
- data/lib/authlogic/session/callbacks.rb +99 -49
- data/lib/authlogic/session/cookies.rb +128 -59
- data/lib/authlogic/session/existence.rb +29 -19
- data/lib/authlogic/session/foundation.rb +70 -16
- data/lib/authlogic/session/http_auth.rb +39 -31
- data/lib/authlogic/session/id.rb +27 -15
- data/lib/authlogic/session/klass.rb +17 -13
- data/lib/authlogic/session/magic_columns.rb +78 -59
- data/lib/authlogic/session/magic_states.rb +50 -27
- data/lib/authlogic/session/params.rb +79 -50
- data/lib/authlogic/session/password.rb +197 -118
- data/lib/authlogic/session/perishable_token.rb +12 -6
- data/lib/authlogic/session/persistence.rb +20 -14
- data/lib/authlogic/session/priority_record.rb +20 -16
- data/lib/authlogic/session/scopes.rb +63 -33
- data/lib/authlogic/session/session.rb +40 -25
- data/lib/authlogic/session/timeout.rb +51 -34
- data/lib/authlogic/session/unauthorized_record.rb +24 -18
- data/lib/authlogic/session/validation.rb +32 -21
- data/lib/authlogic/test_case.rb +123 -35
- data/lib/authlogic/test_case/mock_controller.rb +14 -13
- data/lib/authlogic/test_case/mock_cookie_jar.rb +14 -5
- data/lib/authlogic/test_case/mock_logger.rb +1 -1
- data/lib/authlogic/test_case/mock_request.rb +9 -4
- data/lib/authlogic/test_case/rails_request_adapter.rb +8 -7
- data/lib/authlogic/version.rb +21 -0
- data/test/acts_as_authentic_test/base_test.rb +1 -1
- data/test/acts_as_authentic_test/email_test.rb +80 -63
- data/test/acts_as_authentic_test/logged_in_status_test.rb +14 -8
- data/test/acts_as_authentic_test/login_test.rb +91 -49
- data/test/acts_as_authentic_test/magic_columns_test.rb +13 -13
- data/test/acts_as_authentic_test/password_test.rb +82 -60
- data/test/acts_as_authentic_test/perishable_token_test.rb +31 -25
- data/test/acts_as_authentic_test/persistence_token_test.rb +9 -5
- data/test/acts_as_authentic_test/restful_authentication_test.rb +18 -9
- data/test/acts_as_authentic_test/session_maintenance_test.rb +86 -22
- data/test/acts_as_authentic_test/single_access_test.rb +15 -15
- data/test/adapter_test.rb +21 -0
- data/test/authenticates_many_test.rb +26 -11
- data/test/config_test.rb +9 -9
- data/test/crypto_provider_test/aes256_test.rb +3 -3
- data/test/crypto_provider_test/bcrypt_test.rb +1 -1
- data/test/crypto_provider_test/scrypt_test.rb +2 -2
- data/test/crypto_provider_test/sha1_test.rb +4 -4
- data/test/crypto_provider_test/sha256_test.rb +2 -2
- data/test/crypto_provider_test/sha512_test.rb +3 -3
- data/test/crypto_provider_test/wordpress_test.rb +24 -0
- data/test/gemfiles/Gemfile.rails-4.2.x +2 -2
- data/test/gemfiles/Gemfile.rails-5.0.x +6 -0
- data/test/gemfiles/Gemfile.rails-5.1.x +6 -0
- data/test/gemfiles/Gemfile.rails-5.2.x +6 -0
- data/test/gemfiles/Gemfile.rails-master +6 -0
- data/test/i18n_test.rb +9 -9
- data/test/libs/affiliate.rb +2 -2
- data/test/libs/company.rb +4 -4
- data/test/libs/employee.rb +2 -2
- data/test/libs/employee_session.rb +1 -1
- data/test/libs/ldaper.rb +1 -1
- data/test/libs/project.rb +1 -1
- data/test/libs/user_session.rb +2 -2
- data/test/random_test.rb +9 -38
- data/test/session_test/activation_test.rb +7 -7
- data/test/session_test/active_record_trickery_test.rb +9 -6
- data/test/session_test/brute_force_protection_test.rb +26 -21
- data/test/session_test/callbacks_test.rb +10 -4
- data/test/session_test/cookies_test.rb +54 -20
- data/test/session_test/existence_test.rb +45 -23
- data/test/session_test/foundation_test.rb +17 -1
- data/test/session_test/http_auth_test.rb +11 -12
- data/test/session_test/id_test.rb +3 -3
- data/test/session_test/klass_test.rb +2 -2
- data/test/session_test/magic_columns_test.rb +15 -17
- data/test/session_test/magic_states_test.rb +17 -19
- data/test/session_test/params_test.rb +26 -20
- data/test/session_test/password_test.rb +11 -12
- data/test/session_test/perishability_test.rb +5 -5
- data/test/session_test/persistence_test.rb +4 -3
- data/test/session_test/scopes_test.rb +15 -9
- data/test/session_test/session_test.rb +7 -6
- data/test/session_test/timeout_test.rb +16 -14
- data/test/session_test/unauthorized_record_test.rb +3 -3
- data/test/session_test/validation_test.rb +5 -5
- data/test/test_helper.rb +115 -49
- metadata +107 -36
- data/README.rdoc +0 -232
- data/test/gemfiles/Gemfile.rails-3.2.x +0 -7
- data/test/gemfiles/Gemfile.rails-4.0.x +0 -7
- data/test/gemfiles/Gemfile.rails-4.1.x +0 -7
@@ -1,16 +1,31 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class AuthenticatesManyTest < ActiveSupport::TestCase
|
4
|
-
def
|
5
|
-
zack = users(:zack)
|
6
|
-
ben = users(:ben)
|
4
|
+
def test_employee_sessions
|
7
5
|
binary_logic = companies(:binary_logic)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
|
7
|
+
# Drew is a binary_logic employee, authentication succeeds
|
8
|
+
drew = employees(:drew)
|
9
|
+
set_session_for(drew)
|
10
|
+
assert binary_logic.employee_sessions.find
|
11
|
+
|
12
|
+
# Jennifer is not a binary_logic employee, authentication fails
|
13
|
+
jennifer = employees(:jennifer)
|
14
|
+
set_session_for(jennifer)
|
15
|
+
refute binary_logic.employee_sessions.find
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_user_sessions
|
19
|
+
binary_logic = companies(:binary_logic)
|
20
|
+
|
21
|
+
# Ben is a binary_logic user, authentication succeeds
|
22
|
+
ben = users(:ben)
|
23
|
+
set_session_for(ben, binary_logic)
|
14
24
|
assert binary_logic.user_sessions.find
|
25
|
+
|
26
|
+
# Zack is not a binary_logic user, authentication fails
|
27
|
+
zack = users(:zack)
|
28
|
+
set_session_for(zack, binary_logic)
|
29
|
+
refute binary_logic.user_sessions.find
|
15
30
|
end
|
16
|
-
end
|
31
|
+
end
|
data/test/config_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class ConfigTest < ActiveSupport::TestCase
|
4
4
|
def setup
|
@@ -6,7 +6,7 @@ class ConfigTest < ActiveSupport::TestCase
|
|
6
6
|
extend Authlogic::Config
|
7
7
|
|
8
8
|
def self.foobar(value = nil)
|
9
|
-
rw_config(:foobar_field, value,
|
9
|
+
rw_config(:foobar_field, value, "default_foobar")
|
10
10
|
end
|
11
11
|
}
|
12
12
|
|
@@ -18,19 +18,19 @@ class ConfigTest < ActiveSupport::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_rw_config_read_with_default
|
21
|
-
assert
|
21
|
+
assert "default_foobar", @klass.foobar
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_rw_config_write
|
25
|
-
assert_equal
|
26
|
-
assert_equal
|
25
|
+
assert_equal "my_foobar", @klass.foobar("my_foobar")
|
26
|
+
assert_equal "my_foobar", @klass.foobar
|
27
27
|
|
28
|
-
assert_equal
|
29
|
-
assert_equal
|
28
|
+
assert_equal "my_new_foobar", @klass.foobar("my_new_foobar")
|
29
|
+
assert_equal "my_new_foobar", @klass.foobar
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_subclass_rw_config_write
|
33
|
-
assert_equal
|
34
|
-
assert_equal
|
33
|
+
assert_equal "subklass_foobar", @subklass.foobar("subklass_foobar")
|
34
|
+
assert_equal "default_foobar", @klass.foobar
|
35
35
|
end
|
36
36
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
module CryptoProviderTest
|
4
4
|
class AES256Test < ActiveSupport::TestCase
|
5
5
|
def test_encrypt
|
6
6
|
assert Authlogic::CryptoProviders::AES256.encrypt("mypass")
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
def test_matches
|
10
10
|
hash = Authlogic::CryptoProviders::AES256.encrypt("mypass")
|
11
11
|
assert Authlogic::CryptoProviders::AES256.matches?(hash, "mypass")
|
12
12
|
end
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
module CryptoProviderTest
|
4
4
|
class SCryptTest < ActiveSupport::TestCase
|
5
5
|
def test_encrypt
|
6
6
|
assert Authlogic::CryptoProviders::SCrypt.encrypt("mypass")
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
def test_matches
|
10
10
|
hash = Authlogic::CryptoProviders::SCrypt.encrypt("mypass")
|
11
11
|
assert Authlogic::CryptoProviders::SCrypt.matches?(hash, "mypass")
|
@@ -1,16 +1,16 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
module CryptoProviderTest
|
4
4
|
class Sha1Test < ActiveSupport::TestCase
|
5
5
|
def test_encrypt
|
6
6
|
assert Authlogic::CryptoProviders::Sha1.encrypt("mypass")
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
def test_matches
|
10
10
|
hash = Authlogic::CryptoProviders::Sha1.encrypt("mypass")
|
11
11
|
assert Authlogic::CryptoProviders::Sha1.matches?(hash, "mypass")
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def test_old_restful_authentication_passwords
|
15
15
|
password = "test"
|
16
16
|
salt = "7e3041ebc2fc05a40c60028e2c4901a81035d3cd"
|
@@ -20,4 +20,4 @@ module CryptoProviderTest
|
|
20
20
|
Authlogic::CryptoProviders::Sha1.stretches = 10
|
21
21
|
end
|
22
22
|
end
|
23
|
-
end
|
23
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
module CryptoProviderTest
|
4
4
|
class Sha256Test < ActiveSupport::TestCase
|
5
5
|
def test_encrypt
|
6
6
|
assert Authlogic::CryptoProviders::Sha256.encrypt("mypass")
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
def test_matches
|
10
10
|
hash = Authlogic::CryptoProviders::Sha256.encrypt("mypass")
|
11
11
|
assert Authlogic::CryptoProviders::Sha256.matches?(hash, "mypass")
|
@@ -1,14 +1,14 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
module CryptoProviderTest
|
4
4
|
class Sha512Test < ActiveSupport::TestCase
|
5
5
|
def test_encrypt
|
6
6
|
assert Authlogic::CryptoProviders::Sha512.encrypt("mypass")
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
def test_matches
|
10
10
|
hash = Authlogic::CryptoProviders::Sha512.encrypt("mypass")
|
11
11
|
assert Authlogic::CryptoProviders::Sha512.matches?(hash, "mypass")
|
12
12
|
end
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
::ActiveSupport::Deprecation.silence do
|
4
|
+
require "authlogic/crypto_providers/wordpress"
|
5
|
+
end
|
6
|
+
|
7
|
+
module CryptoProviderTest
|
8
|
+
class WordpressTest < ActiveSupport::TestCase
|
9
|
+
def test_matches
|
10
|
+
plain = "banana"
|
11
|
+
salt = "aaa"
|
12
|
+
crypted = "xxx0nope"
|
13
|
+
# I couldn't figure out how to even execute this method without it
|
14
|
+
# crashing. Maybe, when Jeffry wrote it in 2009, `Digest::MD5.digest`
|
15
|
+
# worked differently. He was probably using ruby 1.9 back then.
|
16
|
+
# Given that I can't even figure out how to run it, and for all the other
|
17
|
+
# reasons I've given in `wordpress.rb`, I'm just going to deprecate
|
18
|
+
# the whole file. -Jared 2018-04-09
|
19
|
+
assert_raises(NoMethodError) {
|
20
|
+
Authlogic::CryptoProviders::Wordpress.matches?(crypted, plain, salt)
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
gemspec :path => "./../.."
|
3
3
|
|
4
|
-
gem "activerecord", "~> 4.2.
|
5
|
-
gem "activesupport", "~> 4.2.
|
4
|
+
gem "activerecord", "~> 4.2.8.rc1"
|
5
|
+
gem "activesupport", "~> 4.2.8.rc1"
|
6
6
|
gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
|
7
7
|
gem 'sqlite3', :platforms => :ruby
|
data/test/i18n_test.rb
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class I18nTest < ActiveSupport::TestCase
|
4
4
|
def test_uses_authlogic_as_scope_by_default
|
5
5
|
assert_equal :authlogic, Authlogic::I18n.scope
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
def test_can_set_scope
|
9
|
-
assert_nothing_raised { Authlogic::I18n.scope = [
|
10
|
-
assert_equal [
|
9
|
+
assert_nothing_raised { Authlogic::I18n.scope = %i[a b] }
|
10
|
+
assert_equal %i[a b], Authlogic::I18n.scope
|
11
11
|
Authlogic::I18n.scope = :authlogic
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def test_uses_built_in_translator_by_default
|
15
15
|
assert_equal Authlogic::I18n::Translator, Authlogic::I18n.translator.class
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def test_can_set_custom_translator
|
19
19
|
old_translator = Authlogic::I18n.translator
|
20
|
-
|
20
|
+
|
21
21
|
assert_nothing_raised do
|
22
22
|
Authlogic::I18n.translator = Class.new do
|
23
|
-
def translate(key,
|
23
|
+
def translate(key, _options = {})
|
24
24
|
"Translated: #{key}"
|
25
25
|
end
|
26
26
|
end.new
|
27
27
|
end
|
28
28
|
|
29
29
|
assert_equal "Translated: x", Authlogic::I18n.translate(:x)
|
30
|
-
|
30
|
+
|
31
31
|
Authlogic::I18n.translator = old_translator
|
32
32
|
end
|
33
33
|
end
|
data/test/libs/affiliate.rb
CHANGED
data/test/libs/company.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Company < ActiveRecord::Base
|
2
2
|
authenticates_many :employee_sessions
|
3
|
-
authenticates_many :user_sessions
|
4
|
-
has_many :employees, :
|
5
|
-
has_many :users, :
|
6
|
-
end
|
3
|
+
authenticates_many :user_sessions, scope_cookies: true
|
4
|
+
has_many :employees, dependent: :destroy
|
5
|
+
has_many :users, dependent: :destroy
|
6
|
+
end
|
data/test/libs/employee.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
class EmployeeSession < Authlogic::Session::Base
|
2
|
-
end
|
2
|
+
end
|
data/test/libs/ldaper.rb
CHANGED
data/test/libs/project.rb
CHANGED
data/test/libs/user_session.rb
CHANGED
data/test/random_test.rb
CHANGED
@@ -1,42 +1,13 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class RandomTest < ActiveSupport::TestCase
|
4
|
-
def
|
5
|
-
|
6
|
-
|
7
|
-
assert_not_equal Authlogic::Random.hex_token, Authlogic::Random.hex_token
|
8
|
-
assert_not_equal Authlogic::Random.friendly_token, Authlogic::Random.friendly_token
|
9
|
-
end
|
4
|
+
def test_that_hex_tokens_are_unique
|
5
|
+
tokens = Array.new(100) { Authlogic::Random.hex_token }
|
6
|
+
assert_equal tokens.size, tokens.uniq.size
|
10
7
|
end
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
def with_secure_random_enabled(enabled = true)
|
18
|
-
# can't really test SecureRandom if we don't have an implementation
|
19
|
-
return if enabled && !Authlogic::Random::SecureRandom
|
20
|
-
|
21
|
-
current_sec_rand = Authlogic::Random::SecureRandom
|
22
|
-
reload_authlogic_with_sec_random!(current_sec_rand, enabled)
|
23
|
-
|
24
|
-
yield
|
25
|
-
ensure
|
26
|
-
reload_authlogic_with_sec_random!(current_sec_rand)
|
27
|
-
end
|
28
|
-
|
29
|
-
def reload_authlogic_with_sec_random!(secure_random, enabled = true)
|
30
|
-
silence_warnings do
|
31
|
-
secure_random.parent.const_set(secure_random.name.sub("#{secure_random.parent}::", ''), enabled ? secure_random : nil)
|
32
|
-
load(File.dirname(__FILE__) + '/../lib/authlogic/random.rb')
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def silence_warnings
|
37
|
-
old_verbose, $VERBOSE = $VERBOSE, nil
|
38
|
-
yield
|
39
|
-
ensure
|
40
|
-
$VERBOSE = old_verbose
|
41
|
-
end
|
42
|
-
end
|
9
|
+
def test_that_friendly_tokens_are_unique
|
10
|
+
tokens = Array.new(100) { Authlogic::Random.friendly_token }
|
11
|
+
assert_equal tokens.size, tokens.uniq.size
|
12
|
+
end
|
13
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
module SessionTest
|
4
4
|
module ActivationTest
|
@@ -6,9 +6,9 @@ module SessionTest
|
|
6
6
|
def test_activated
|
7
7
|
assert UserSession.activated?
|
8
8
|
Authlogic::Session::Base.controller = nil
|
9
|
-
|
9
|
+
refute UserSession.activated?
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def test_controller
|
13
13
|
Authlogic::Session::Base.controller = nil
|
14
14
|
assert_nil Authlogic::Session::Base.controller
|
@@ -20,18 +20,18 @@ module SessionTest
|
|
20
20
|
thread1.join
|
21
21
|
|
22
22
|
assert_nil Authlogic::Session::Base.controller
|
23
|
-
|
23
|
+
|
24
24
|
thread2 = Thread.new do
|
25
25
|
controller = MockController.new
|
26
26
|
Authlogic::Session::Base.controller = controller
|
27
27
|
assert_equal controller, Authlogic::Session::Base.controller
|
28
28
|
end
|
29
29
|
thread2.join
|
30
|
-
|
30
|
+
|
31
31
|
assert_nil Authlogic::Session::Base.controller
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
class InstanceMethodsTest < ActiveSupport::TestCase
|
36
36
|
def test_init
|
37
37
|
UserSession.controller = nil
|
@@ -40,4 +40,4 @@ module SessionTest
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end
|