authlogic 3.4.6 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +5 -5
  2. data/.github/ISSUE_TEMPLATE.md +13 -0
  3. data/.github/triage.md +87 -0
  4. data/.gitignore +4 -0
  5. data/.rubocop.yml +127 -0
  6. data/.rubocop_todo.yml +65 -0
  7. data/.travis.yml +18 -10
  8. data/CHANGELOG.md +156 -6
  9. data/CONTRIBUTING.md +71 -3
  10. data/Gemfile +2 -2
  11. data/README.md +386 -0
  12. data/Rakefile +13 -7
  13. data/UPGRADING.md +22 -0
  14. data/authlogic.gemspec +33 -22
  15. data/lib/authlogic.rb +60 -52
  16. data/lib/authlogic/acts_as_authentic/base.rb +40 -26
  17. data/lib/authlogic/acts_as_authentic/email.rb +96 -32
  18. data/lib/authlogic/acts_as_authentic/logged_in_status.rb +36 -12
  19. data/lib/authlogic/acts_as_authentic/login.rb +114 -49
  20. data/lib/authlogic/acts_as_authentic/magic_columns.rb +17 -6
  21. data/lib/authlogic/acts_as_authentic/password.rb +296 -139
  22. data/lib/authlogic/acts_as_authentic/perishable_token.rb +34 -20
  23. data/lib/authlogic/acts_as_authentic/persistence_token.rb +20 -24
  24. data/lib/authlogic/acts_as_authentic/queries/find_with_case.rb +67 -0
  25. data/lib/authlogic/acts_as_authentic/restful_authentication.rb +68 -23
  26. data/lib/authlogic/acts_as_authentic/session_maintenance.rb +128 -85
  27. data/lib/authlogic/acts_as_authentic/single_access_token.rb +41 -25
  28. data/lib/authlogic/acts_as_authentic/validations_scope.rb +8 -8
  29. data/lib/authlogic/authenticates_many/association.rb +22 -14
  30. data/lib/authlogic/authenticates_many/base.rb +35 -16
  31. data/lib/authlogic/config.rb +10 -10
  32. data/lib/authlogic/controller_adapters/abstract_adapter.rb +40 -12
  33. data/lib/authlogic/controller_adapters/rack_adapter.rb +15 -8
  34. data/lib/authlogic/controller_adapters/rails_adapter.rb +42 -22
  35. data/lib/authlogic/controller_adapters/sinatra_adapter.rb +3 -3
  36. data/lib/authlogic/crypto_providers.rb +91 -0
  37. data/lib/authlogic/crypto_providers/aes256.rb +42 -14
  38. data/lib/authlogic/crypto_providers/bcrypt.rb +35 -20
  39. data/lib/authlogic/crypto_providers/md5.rb +11 -9
  40. data/lib/authlogic/crypto_providers/scrypt.rb +26 -13
  41. data/lib/authlogic/crypto_providers/sha1.rb +14 -8
  42. data/lib/authlogic/crypto_providers/sha256.rb +16 -12
  43. data/lib/authlogic/crypto_providers/sha512.rb +8 -24
  44. data/lib/authlogic/crypto_providers/wordpress.rb +44 -15
  45. data/lib/authlogic/i18n.rb +33 -20
  46. data/lib/authlogic/i18n/translator.rb +1 -1
  47. data/lib/authlogic/random.rb +12 -29
  48. data/lib/authlogic/regex.rb +59 -27
  49. data/lib/authlogic/session/activation.rb +36 -23
  50. data/lib/authlogic/session/active_record_trickery.rb +13 -10
  51. data/lib/authlogic/session/base.rb +20 -8
  52. data/lib/authlogic/session/brute_force_protection.rb +87 -56
  53. data/lib/authlogic/session/callbacks.rb +99 -49
  54. data/lib/authlogic/session/cookies.rb +128 -59
  55. data/lib/authlogic/session/existence.rb +29 -19
  56. data/lib/authlogic/session/foundation.rb +70 -16
  57. data/lib/authlogic/session/http_auth.rb +39 -31
  58. data/lib/authlogic/session/id.rb +27 -15
  59. data/lib/authlogic/session/klass.rb +17 -13
  60. data/lib/authlogic/session/magic_columns.rb +78 -59
  61. data/lib/authlogic/session/magic_states.rb +50 -27
  62. data/lib/authlogic/session/params.rb +79 -50
  63. data/lib/authlogic/session/password.rb +197 -118
  64. data/lib/authlogic/session/perishable_token.rb +12 -6
  65. data/lib/authlogic/session/persistence.rb +20 -14
  66. data/lib/authlogic/session/priority_record.rb +20 -16
  67. data/lib/authlogic/session/scopes.rb +63 -33
  68. data/lib/authlogic/session/session.rb +40 -25
  69. data/lib/authlogic/session/timeout.rb +51 -34
  70. data/lib/authlogic/session/unauthorized_record.rb +24 -18
  71. data/lib/authlogic/session/validation.rb +32 -21
  72. data/lib/authlogic/test_case.rb +123 -35
  73. data/lib/authlogic/test_case/mock_controller.rb +14 -13
  74. data/lib/authlogic/test_case/mock_cookie_jar.rb +14 -5
  75. data/lib/authlogic/test_case/mock_logger.rb +1 -1
  76. data/lib/authlogic/test_case/mock_request.rb +9 -4
  77. data/lib/authlogic/test_case/rails_request_adapter.rb +8 -7
  78. data/lib/authlogic/version.rb +21 -0
  79. data/test/acts_as_authentic_test/base_test.rb +1 -1
  80. data/test/acts_as_authentic_test/email_test.rb +80 -63
  81. data/test/acts_as_authentic_test/logged_in_status_test.rb +14 -8
  82. data/test/acts_as_authentic_test/login_test.rb +91 -49
  83. data/test/acts_as_authentic_test/magic_columns_test.rb +13 -13
  84. data/test/acts_as_authentic_test/password_test.rb +82 -60
  85. data/test/acts_as_authentic_test/perishable_token_test.rb +31 -25
  86. data/test/acts_as_authentic_test/persistence_token_test.rb +9 -5
  87. data/test/acts_as_authentic_test/restful_authentication_test.rb +18 -9
  88. data/test/acts_as_authentic_test/session_maintenance_test.rb +86 -22
  89. data/test/acts_as_authentic_test/single_access_test.rb +15 -15
  90. data/test/adapter_test.rb +21 -0
  91. data/test/authenticates_many_test.rb +26 -11
  92. data/test/config_test.rb +9 -9
  93. data/test/crypto_provider_test/aes256_test.rb +3 -3
  94. data/test/crypto_provider_test/bcrypt_test.rb +1 -1
  95. data/test/crypto_provider_test/scrypt_test.rb +2 -2
  96. data/test/crypto_provider_test/sha1_test.rb +4 -4
  97. data/test/crypto_provider_test/sha256_test.rb +2 -2
  98. data/test/crypto_provider_test/sha512_test.rb +3 -3
  99. data/test/crypto_provider_test/wordpress_test.rb +24 -0
  100. data/test/gemfiles/Gemfile.rails-4.2.x +2 -2
  101. data/test/gemfiles/Gemfile.rails-5.0.x +6 -0
  102. data/test/gemfiles/Gemfile.rails-5.1.x +6 -0
  103. data/test/gemfiles/Gemfile.rails-5.2.x +6 -0
  104. data/test/gemfiles/Gemfile.rails-master +6 -0
  105. data/test/i18n_test.rb +9 -9
  106. data/test/libs/affiliate.rb +2 -2
  107. data/test/libs/company.rb +4 -4
  108. data/test/libs/employee.rb +2 -2
  109. data/test/libs/employee_session.rb +1 -1
  110. data/test/libs/ldaper.rb +1 -1
  111. data/test/libs/project.rb +1 -1
  112. data/test/libs/user_session.rb +2 -2
  113. data/test/random_test.rb +9 -38
  114. data/test/session_test/activation_test.rb +7 -7
  115. data/test/session_test/active_record_trickery_test.rb +9 -6
  116. data/test/session_test/brute_force_protection_test.rb +26 -21
  117. data/test/session_test/callbacks_test.rb +10 -4
  118. data/test/session_test/cookies_test.rb +54 -20
  119. data/test/session_test/existence_test.rb +45 -23
  120. data/test/session_test/foundation_test.rb +17 -1
  121. data/test/session_test/http_auth_test.rb +11 -12
  122. data/test/session_test/id_test.rb +3 -3
  123. data/test/session_test/klass_test.rb +2 -2
  124. data/test/session_test/magic_columns_test.rb +15 -17
  125. data/test/session_test/magic_states_test.rb +17 -19
  126. data/test/session_test/params_test.rb +26 -20
  127. data/test/session_test/password_test.rb +11 -12
  128. data/test/session_test/perishability_test.rb +5 -5
  129. data/test/session_test/persistence_test.rb +4 -3
  130. data/test/session_test/scopes_test.rb +15 -9
  131. data/test/session_test/session_test.rb +7 -6
  132. data/test/session_test/timeout_test.rb +16 -14
  133. data/test/session_test/unauthorized_record_test.rb +3 -3
  134. data/test/session_test/validation_test.rb +5 -5
  135. data/test/test_helper.rb +115 -49
  136. metadata +107 -36
  137. data/README.rdoc +0 -232
  138. data/test/gemfiles/Gemfile.rails-3.2.x +0 -7
  139. data/test/gemfiles/Gemfile.rails-4.0.x +0 -7
  140. data/test/gemfiles/Gemfile.rails-4.1.x +0 -7
@@ -1,16 +1,31 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  class AuthenticatesManyTest < ActiveSupport::TestCase
4
- def test_scoping
5
- zack = users(:zack)
6
- ben = users(:ben)
4
+ def test_employee_sessions
7
5
  binary_logic = companies(:binary_logic)
8
- set_session_for(zack)
9
-
10
- assert !binary_logic.user_sessions.find
11
-
12
- set_session_for(ben)
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
@@ -1,4 +1,4 @@
1
- require 'test_helper'
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, 'default_foobar')
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 'default_foobar', @klass.foobar
21
+ assert "default_foobar", @klass.foobar
22
22
  end
23
23
 
24
24
  def test_rw_config_write
25
- assert_equal 'my_foobar', @klass.foobar('my_foobar')
26
- assert_equal 'my_foobar', @klass.foobar
25
+ assert_equal "my_foobar", @klass.foobar("my_foobar")
26
+ assert_equal "my_foobar", @klass.foobar
27
27
 
28
- assert_equal 'my_new_foobar', @klass.foobar('my_new_foobar')
29
- assert_equal 'my_new_foobar', @klass.foobar
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 'subklass_foobar', @subklass.foobar('subklass_foobar')
34
- assert_equal 'default_foobar', @klass.foobar
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 'test_helper'
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,4 +1,4 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  module CryptoProviderTest
4
4
  class BCryptTest < ActiveSupport::TestCase
@@ -1,11 +1,11 @@
1
- require 'test_helper'
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 'test_helper'
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 'test_helper'
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 'test_helper'
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.0"
5
- gem "activesupport", "~> 4.2.0"
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
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activerecord", "~> 5.0.1"
5
+ gem "activesupport", "~> 5.0.1"
6
+ gem 'sqlite3', :platforms => :ruby
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activerecord", "~> 5.1.0"
5
+ gem "activesupport", "~> 5.1.0"
6
+ gem 'sqlite3', :platforms => :ruby
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activerecord", "~> 5.2.x"
5
+ gem "activesupport", "~> 5.2.x"
6
+ gem 'sqlite3', :platforms => :ruby
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activerecord", github: "rails/rails"
5
+ gem "activesupport", github: "rails/rails"
6
+ gem "sqlite3", :platforms => :ruby
@@ -1,33 +1,33 @@
1
- require 'test_helper'
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 = [:a, :b] }
10
- assert_equal [:a, :b], Authlogic::I18n.scope
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, options = {})
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
@@ -2,6 +2,6 @@ class Affiliate < ActiveRecord::Base
2
2
  acts_as_authentic do |c|
3
3
  c.crypted_password_field = :pw_hash
4
4
  end
5
-
5
+
6
6
  belongs_to :company
7
- end
7
+ end
@@ -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, :dependent => :destroy
5
- has_many :users, :dependent => :destroy
6
- end
3
+ authenticates_many :user_sessions, scope_cookies: true
4
+ has_many :employees, dependent: :destroy
5
+ has_many :users, dependent: :destroy
6
+ end
@@ -2,6 +2,6 @@ class Employee < ActiveRecord::Base
2
2
  acts_as_authentic do |c|
3
3
  c.crypto_provider Authlogic::CryptoProviders::AES256
4
4
  end
5
-
5
+
6
6
  belongs_to :company
7
- end
7
+ end
@@ -1,2 +1,2 @@
1
1
  class EmployeeSession < Authlogic::Session::Base
2
- end
2
+ end
@@ -1,3 +1,3 @@
1
1
  class Ldaper < ActiveRecord::Base
2
2
  acts_as_authentic
3
- end
3
+ end
@@ -1,3 +1,3 @@
1
1
  class Project < ActiveRecord::Base
2
2
  has_and_belongs_to_many :users
3
- end
3
+ end
@@ -15,11 +15,11 @@ class WackyUserSession < Authlogic::Session::Base
15
15
 
16
16
  def persist_by_false
17
17
  self.counter += 1
18
- return false
18
+ false
19
19
  end
20
20
 
21
21
  def persist_by_true
22
22
  self.counter += 1
23
- return true
23
+ true
24
24
  end
25
25
  end
@@ -1,42 +1,13 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  class RandomTest < ActiveSupport::TestCase
4
- def test_random_tokens_are_indeed_random
5
- # this might fail if you are *really* unlucky :)
6
- with_any_random do
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
- private
13
- def with_any_random(&block)
14
- [true, false].each {|val| with_secure_random_enabled(val, &block)}
15
- end
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 'test_helper'
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
- assert !UserSession.activated?
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