clearance 1.0.0 → 1.0.1

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dee0a601f1ee2b04fc8878923101650fc4304caa
4
- data.tar.gz: 7327399d9f9e95f00b7846b2969a57617f0f6a80
3
+ metadata.gz: f4e6710b70b803fe467aabe7d840cbfa3f18c0d4
4
+ data.tar.gz: b8728d50e2609028e65810667d3853aebc975b71
5
5
  SHA512:
6
- metadata.gz: 3972adda04cb8f7a6d61d963cd5454b1dece3836e74722d91f59b5749a8f88b0e84e437461336c3ed30b9fe3f469d058e06340e339ba78ae48b784ce1dd9d3d5
7
- data.tar.gz: 177c710269e683a5a97af3ee372be2fed1db48cb49089c9156a9adc5538c20f3ecf47519546a44fb92a70be212f0794cb6915a5930f33579cba0c1b6f110bb3a
6
+ metadata.gz: 472bd52036488dd09691f23a4065f0394bdfb48c3784d56824871861a1ff6f6497b1d5d8863c021e4a656479314bb08c74a311aca22cca057fea44ee5a952cc0
7
+ data.tar.gz: 05ba71e0e4e71104e181487c010e30a827b482b4a000c3b7ef9a1c3e90e4b3df6004247fbd59d01af70c7957dc8284163396c2343ecc5e2f8ec0c95277df18ca
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- clearance (1.0.0)
12
+ clearance (1.0.1)
13
13
  bcrypt-ruby
14
14
  email_validator (~> 1.4)
15
15
  rails (>= 3.1)
data/NEWS.md CHANGED
@@ -1,5 +1,9 @@
1
1
  Thank you to all the [contributors](https://github.com/thoughtbot/clearance/graphs/contributors)!
2
2
 
3
+ New for 1.0.1 (August 9, 2013):
4
+
5
+ * Fix an issue when trying to sign in with `nil`
6
+
3
7
  New for 1.0.0 (August 1, 2013):
4
8
 
5
9
  * Support Rails 4.
@@ -25,8 +25,8 @@ module Clearance
25
25
  end
26
26
 
27
27
  def sign_in(user)
28
+ cookies[REMEMBER_TOKEN_COOKIE] = user && user.remember_token
28
29
  @current_user = user
29
- cookies[REMEMBER_TOKEN_COOKIE] = @current_user.remember_token
30
30
  end
31
31
 
32
32
  def sign_out
@@ -1,3 +1,3 @@
1
1
  module Clearance
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -25,17 +25,26 @@ describe Clearance::Session do
25
25
  end
26
26
 
27
27
  it 'returns nil without a remember token' do
28
- env = env_without_remember_token
29
- session = Clearance::Session.new(env)
30
28
  session.should be_signed_out
31
29
  session.current_user.should be_nil
32
30
  end
33
31
 
34
- it 'signs in a given user' do
35
- user = create(:user)
36
- session = Clearance::Session.new(env_without_remember_token)
37
- session.sign_in user
38
- session.current_user.should == user
32
+ describe '#sign_in' do
33
+ it 'sets current_user' do
34
+ user = build(:user)
35
+
36
+ session.sign_in user
37
+
38
+ expect(session.current_user).to eq user
39
+ end
40
+
41
+ context 'with nil argument' do
42
+ it 'assigns current_user' do
43
+ session.sign_in nil
44
+
45
+ expect(session.current_user).to be_nil
46
+ end
47
+ end
39
48
  end
40
49
 
41
50
  context 'if httponly is set' do
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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Croak
@@ -25,7 +25,7 @@ authors:
25
25
  autorequire:
26
26
  bindir: bin
27
27
  cert_chain: []
28
- date: 2013-08-01 00:00:00.000000000 Z
28
+ date: 2013-08-10 00:00:00.000000000 Z
29
29
  dependencies:
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: bcrypt-ruby
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  requirements: []
211
211
  rubyforge_project:
212
- rubygems_version: 2.0.5
212
+ rubygems_version: 2.0.3
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: Rails authentication & authorization with email & password.