clearance 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of clearance might be problematic. Click here for more details.
- data/CHANGELOG.md +4 -0
- data/VERSION +1 -1
- data/lib/clearance/authentication.rb +2 -2
- data/test/controllers/confirmations_controller_test.rb +4 -0
- data/test/controllers/sessions_controller_test.rb +4 -0
- data/test/rails_root/db/migrate/{20100221200020_clearance_create_users.rb → 20100225210436_clearance_create_users.rb} +0 -0
- metadata +3 -4
- data/test/rails_root/config/initializers/clearance_loader.rb +0 -8
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.8
|
@@ -66,7 +66,7 @@ module Clearance
|
|
66
66
|
:value => user.remember_token,
|
67
67
|
:expires => 1.year.from_now.utc
|
68
68
|
}
|
69
|
-
current_user = user
|
69
|
+
self.current_user = user
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
@@ -77,7 +77,7 @@ module Clearance
|
|
77
77
|
def sign_out
|
78
78
|
current_user.reset_remember_token! if current_user
|
79
79
|
cookies.delete(:remember_token)
|
80
|
-
current_user = nil
|
80
|
+
self.current_user = nil
|
81
81
|
end
|
82
82
|
|
83
83
|
# Store the current location and redirect to sign in.
|
@@ -23,6 +23,10 @@ class ConfirmationsControllerTest < ActionController::TestCase
|
|
23
23
|
should_set_the_flash_to /confirmed email/i
|
24
24
|
should_set_the_flash_to /signed in/i
|
25
25
|
should_redirect_to_url_after_create
|
26
|
+
|
27
|
+
should "set the current user" do
|
28
|
+
assert_equal @user, @controller.current_user
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
context "with an incorrect token" do
|
@@ -137,6 +137,10 @@ class SessionsControllerTest < ActionController::TestCase
|
|
137
137
|
should "reset the remember token" do
|
138
138
|
assert_not_equal "old-token", @user.reload.remember_token
|
139
139
|
end
|
140
|
+
|
141
|
+
should "unset the current user" do
|
142
|
+
assert_nil @controller.current_user
|
143
|
+
end
|
140
144
|
end
|
141
145
|
|
142
146
|
end
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Croak
|
@@ -26,7 +26,7 @@ autorequire:
|
|
26
26
|
bindir: bin
|
27
27
|
cert_chain: []
|
28
28
|
|
29
|
-
date: 2010-02-
|
29
|
+
date: 2010-02-25 00:00:00 -05:00
|
30
30
|
default_executable:
|
31
31
|
dependencies: []
|
32
32
|
|
@@ -138,13 +138,12 @@ test_files:
|
|
138
138
|
- test/rails_root/config/environments/production.rb
|
139
139
|
- test/rails_root/config/environments/test.rb
|
140
140
|
- test/rails_root/config/initializers/clearance.rb
|
141
|
-
- test/rails_root/config/initializers/clearance_loader.rb
|
142
141
|
- test/rails_root/config/initializers/inflections.rb
|
143
142
|
- test/rails_root/config/initializers/mime_types.rb
|
144
143
|
- test/rails_root/config/initializers/requires.rb
|
145
144
|
- test/rails_root/config/initializers/time_formats.rb
|
146
145
|
- test/rails_root/config/routes.rb
|
147
|
-
- test/rails_root/db/migrate/
|
146
|
+
- test/rails_root/db/migrate/20100225210436_clearance_create_users.rb
|
148
147
|
- test/rails_root/features/step_definitions/clearance_steps.rb
|
149
148
|
- test/rails_root/features/step_definitions/factory_girl_steps.rb
|
150
149
|
- test/rails_root/features/step_definitions/web_steps.rb
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# This simulates loading the clearance gem, but without relying on
|
2
|
-
# vendor/gems
|
3
|
-
|
4
|
-
clearance_path = File.join(File.dirname(__FILE__), *%w(.. .. .. ..))
|
5
|
-
clearance_lib_path = File.join(clearance_path, "lib")
|
6
|
-
|
7
|
-
$LOAD_PATH.unshift(clearance_lib_path)
|
8
|
-
load File.join(clearance_path, 'rails', 'init.rb')
|