thoughtbot-clearance 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@ Specify the gem dependency in your config/environment.rb file:
19
19
  # ...
20
20
  config.gem 'thoughtbot-shoulda', :lib => 'shoulda', :source => "http://gems.github.com"
21
21
  config.gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :source => "http://gems.github.com"
22
- config.gem "dancroak-clearance", :lib => 'clearance', :source => 'http://gems.github.com/'
22
+ config.gem "thoughtbot-clearance", :lib => 'clearance', :source => 'http://gems.github.com/'
23
23
  end
24
24
 
25
25
  Then:
@@ -105,7 +105,8 @@ Change your User model so it has these attributes:
105
105
  t.column :remember_token_expires_at, :datetime
106
106
  end
107
107
 
108
- add_index :users, [:email, :crypted_password]
108
+ add_index :users, :email
109
+ add_index :users, :remember_token
109
110
 
110
111
  h2. User Model
111
112
 
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "clearance"
3
- s.version = "0.1.4"
3
+ s.version = "0.1.5"
4
4
  s.date = "2008-09-24"
5
5
  s.summary = "Simple, complete Rails authentication."
6
6
  s.email = "dcroak@thoughtbot.com"
7
- s.homepage = "http://github.com/dancroak/clearance"
7
+ s.homepage = "http://github.com/thoughtbot/clearance"
8
8
  s.description = "Simple, complete Rails authentication scheme."
9
9
  s.authors = ["thoughtbot, inc.", "Dan Croak", "Josh Nichols", "Mike Breen", "Mike Burns", "Jason Morrison"]
10
10
  s.files = ["README.textile",
@@ -27,7 +27,13 @@ module Clearance
27
27
 
28
28
  should_set_the_flash_to /success/i
29
29
  should_redirect_to '@controller.send(:url_after_create)'
30
- # TODO: should set session
30
+ #should_return_from_session(:user_id, '@user.id')
31
+ should "return the correct value from the session for key :user_id" do
32
+ instantiate_variables_from_assigns do
33
+ expected_value = @user.id
34
+ assert_equal expected_value, session[:user_id], "Expected #{expected_value.inspect} but was #{session[:user_id]}"
35
+ end
36
+ end
31
37
  end
32
38
 
33
39
  context "a POST to #create with bad credentials" do
@@ -37,15 +43,19 @@ module Clearance
37
43
 
38
44
  should_set_the_flash_to /bad/i
39
45
  should_render_template :new
40
- # TODO: should not set session
46
+ #should_return_from_session(:user_id, 'nil')
47
+ should "return the correct value from the session for key :user_id" do
48
+ instantiate_variables_from_assigns do
49
+ expected_value = @user.id
50
+ assert_equal expected_value, session[:user_id], "Expected #{expected_value.inspect} but was #{session[:user_id]}"
51
+ end
52
+ end
41
53
  end
42
54
 
43
55
  # TODO: two tests for remember me - success and failure
44
56
  end
45
57
 
46
- context "While logged out" do
47
- setup { logout }
48
-
58
+ public_context do
49
59
  context "logging out again" do
50
60
  setup { delete :destroy }
51
61
  should_redirect_to '@controller.send(:url_after_destroy)'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thoughtbot-clearance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot, inc.
@@ -39,7 +39,7 @@ files:
39
39
  - lib/clearance/app/controllers/users_controller.rb
40
40
  - lib/clearance/test/functionals/users_controller_test.rb
41
41
  has_rdoc: false
42
- homepage: http://github.com/dancroak/clearance
42
+ homepage: http://github.com/thoughtbot/clearance
43
43
  post_install_message:
44
44
  rdoc_options: []
45
45