minimalist_authentication 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c65a309516fd2b0a5afbf28b77a7ffeb67555a7b
4
- data.tar.gz: 5bf9f68654fc956fc7c64ff807ce9c3af08a7b9f
3
+ metadata.gz: 3f7c9974d5123adc207f585ba87d63be93f7e2d1
4
+ data.tar.gz: e79d7be17c1761184e15b01d663022c26be8a47a
5
5
  SHA512:
6
- metadata.gz: 92e68754d6feaf9cdc352136c919a7a0b7c7e0a9df22b16812058041c8d473eb09591bfacbab2266692533b929ba7a59010585ac78f392dbb8e3e12b0c5144e1
7
- data.tar.gz: 924aa924215b8f777398c8651bee54bd1dd21f79e7ed807f3572e32d7a6cda44e0aa5297dccbdfb96dc587f0c73cb46c13b3beadd2a3d233ec62b00a524c3123
6
+ metadata.gz: 06ee1715286f3c8fba8456759710b7aaaeed61de15c45ffee0db2faf47362612af73519c65f305e9347e1636f61e0ec1a4d71c78ed6ff1c23fee89cb3163d5f0
7
+ data.tar.gz: d92bb2ea985da401c4292541d2a8262e23bd7939fa523191ec42c83b42171688f0329374f462c6f1d98609c63d87ca4f814b7f6d6df3ac4f341bc13cf7e00935
data/Gemfile.lock CHANGED
@@ -1,79 +1,92 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minimalist_authentication (0.6.6)
4
+ minimalist_authentication (0.6.8)
5
5
  bcrypt-ruby (~> 3.1.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- abstract (1.0.0)
11
- actionmailer (3.0.5)
12
- actionpack (= 3.0.5)
13
- mail (~> 2.2.15)
14
- actionpack (3.0.5)
15
- activemodel (= 3.0.5)
16
- activesupport (= 3.0.5)
17
- builder (~> 2.1.2)
18
- erubis (~> 2.6.6)
19
- i18n (~> 0.4)
20
- rack (~> 1.2.1)
21
- rack-mount (~> 0.6.13)
22
- rack-test (~> 0.5.7)
23
- tzinfo (~> 0.3.23)
24
- activemodel (3.0.5)
25
- activesupport (= 3.0.5)
26
- builder (~> 2.1.2)
27
- i18n (~> 0.4)
28
- activerecord (3.0.5)
29
- activemodel (= 3.0.5)
30
- activesupport (= 3.0.5)
31
- arel (~> 2.0.2)
32
- tzinfo (~> 0.3.23)
33
- activeresource (3.0.5)
34
- activemodel (= 3.0.5)
35
- activesupport (= 3.0.5)
36
- activesupport (3.0.5)
37
- arel (2.0.10)
38
- bcrypt-ruby (3.1.1)
39
- builder (2.1.2)
40
- erubis (2.6.6)
41
- abstract (>= 1.0.0)
42
- factory_girl (2.5.0)
43
- activesupport
44
- i18n (0.6.0)
45
- mail (2.2.19)
46
- activesupport (>= 2.3.6)
47
- i18n (>= 0.4.0)
10
+ actionmailer (3.2.14)
11
+ actionpack (= 3.2.14)
12
+ mail (~> 2.5.4)
13
+ actionpack (3.2.14)
14
+ activemodel (= 3.2.14)
15
+ activesupport (= 3.2.14)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.5)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.14)
24
+ activesupport (= 3.2.14)
25
+ builder (~> 3.0.0)
26
+ activerecord (3.2.14)
27
+ activemodel (= 3.2.14)
28
+ activesupport (= 3.2.14)
29
+ arel (~> 3.0.2)
30
+ tzinfo (~> 0.3.29)
31
+ activeresource (3.2.14)
32
+ activemodel (= 3.2.14)
33
+ activesupport (= 3.2.14)
34
+ activesupport (3.2.14)
35
+ i18n (~> 0.6, >= 0.6.4)
36
+ multi_json (~> 1.0)
37
+ arel (3.0.2)
38
+ bcrypt-ruby (3.1.2)
39
+ builder (3.0.4)
40
+ erubis (2.7.0)
41
+ factory_girl (4.2.0)
42
+ activesupport (>= 3.0.0)
43
+ hike (1.2.3)
44
+ i18n (0.6.5)
45
+ journey (1.0.4)
46
+ json (1.8.0)
47
+ mail (2.5.4)
48
48
  mime-types (~> 1.16)
49
49
  treetop (~> 1.4.8)
50
- mime-types (1.17.2)
50
+ mime-types (1.25)
51
+ multi_json (1.8.0)
51
52
  polyglot (0.3.3)
52
- rack (1.2.5)
53
- rack-mount (0.6.14)
54
- rack (>= 1.0.0)
55
- rack-test (0.5.7)
53
+ rack (1.4.5)
54
+ rack-cache (1.2)
55
+ rack (>= 0.4)
56
+ rack-ssl (1.3.3)
57
+ rack
58
+ rack-test (0.6.2)
56
59
  rack (>= 1.0)
57
- rails (3.0.5)
58
- actionmailer (= 3.0.5)
59
- actionpack (= 3.0.5)
60
- activerecord (= 3.0.5)
61
- activeresource (= 3.0.5)
62
- activesupport (= 3.0.5)
60
+ rails (3.2.14)
61
+ actionmailer (= 3.2.14)
62
+ actionpack (= 3.2.14)
63
+ activerecord (= 3.2.14)
64
+ activeresource (= 3.2.14)
65
+ activesupport (= 3.2.14)
63
66
  bundler (~> 1.0)
64
- railties (= 3.0.5)
65
- railties (3.0.5)
66
- actionpack (= 3.0.5)
67
- activesupport (= 3.0.5)
67
+ railties (= 3.2.14)
68
+ railties (3.2.14)
69
+ actionpack (= 3.2.14)
70
+ activesupport (= 3.2.14)
71
+ rack-ssl (~> 1.3.2)
68
72
  rake (>= 0.8.7)
69
- thor (~> 0.14.4)
70
- rake (0.9.2.2)
71
- sqlite3 (1.3.5)
72
- thor (0.14.6)
73
- treetop (1.4.10)
73
+ rdoc (~> 3.4)
74
+ thor (>= 0.14.6, < 2.0)
75
+ rake (10.1.0)
76
+ rdoc (3.12.2)
77
+ json (~> 1.4)
78
+ sprockets (2.2.2)
79
+ hike (~> 1.2)
80
+ multi_json (~> 1.0)
81
+ rack (~> 1.0)
82
+ tilt (~> 1.1, != 1.3.0)
83
+ sqlite3 (1.3.8)
84
+ thor (0.18.1)
85
+ tilt (1.4.1)
86
+ treetop (1.4.15)
74
87
  polyglot
75
88
  polyglot (>= 0.3.1)
76
- tzinfo (0.3.32)
89
+ tzinfo (0.3.37)
77
90
 
78
91
  PLATFORMS
79
92
  ruby
@@ -81,5 +94,5 @@ PLATFORMS
81
94
  DEPENDENCIES
82
95
  factory_girl
83
96
  minimalist_authentication!
84
- rails (= 3.0.5)
97
+ rails (= 3.2.14)
85
98
  sqlite3
@@ -81,7 +81,7 @@ module Minimalist
81
81
  end
82
82
 
83
83
  def logged_in
84
- self.class.update_all("last_logged_in_at='#{Time.now.to_s(:db)}'", "id=#{self.id}") # use update_all to avoid updated_on trigger
84
+ update_column(:last_logged_in_at, Time.now.to_s(:db)) # use update_column to avoid updated_on trigger
85
85
  end
86
86
 
87
87
  def is_guest?
@@ -1,3 +1,3 @@
1
1
  module MinimalistAuthentication
2
- VERSION = '0.6.7'
2
+ VERSION = '0.6.8'
3
3
  end
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_dependency 'bcrypt-ruby', '~> 3.1.1'
19
19
 
20
- s.add_development_dependency 'rails','3.0.5'
20
+ s.add_development_dependency 'rails','3.2.14'
21
21
  s.add_development_dependency 'sqlite3'
22
22
  s.add_development_dependency 'factory_girl'
23
23
  end
@@ -3,7 +3,7 @@ require 'test_helper'
3
3
  class AuthenticationTest < ActiveSupport::TestCase
4
4
 
5
5
  test "should not be able to set crypted_password through mass assignment" do
6
- user = Factory(:user)
6
+ user = FactoryGirl.create(:user)
7
7
  old_crypted_password = user.crypted_password
8
8
  old_digest_version = user.using_digest_version
9
9
  old_salt = user.salt
@@ -14,32 +14,32 @@ class AuthenticationTest < ActiveSupport::TestCase
14
14
  end
15
15
 
16
16
  test "should return active user" do
17
- user = Factory(:user)
17
+ user = FactoryGirl.create(:user)
18
18
  assert_equal([user], User.active)
19
19
  end
20
20
 
21
21
  test "should authenticate user" do
22
- user = Factory(:user)
22
+ user = FactoryGirl.create(:user)
23
23
  assert_equal(user, User.authenticate(user.email, 'password'))
24
24
  end
25
25
 
26
26
  test "should fail to authenticate when email is blank" do
27
- user = Factory(:user)
27
+ user = FactoryGirl.create(:user)
28
28
  assert_nil(User.authenticate('', 'password'))
29
29
  end
30
30
 
31
31
  test "should fail to authenticate when password is blank" do
32
- user = Factory(:user)
32
+ user = FactoryGirl.create(:user)
33
33
  assert_nil(User.authenticate(user.email, ''))
34
34
  end
35
35
 
36
36
  test "should fail to authenticate when user is not active" do
37
- user = Factory(:user, :active => false)
37
+ user = FactoryGirl.create(:user, :active => false)
38
38
  assert_nil(User.authenticate(user.email, 'password'))
39
39
  end
40
40
 
41
41
  test "should fail to authenticate for incorrect password" do
42
- user = Factory(:user)
42
+ user = FactoryGirl.create(:user)
43
43
  assert_nil(User.authenticate(user.email, 'incorrect_password'))
44
44
  end
45
45
 
@@ -52,7 +52,7 @@ class AuthenticationTest < ActiveSupport::TestCase
52
52
  end
53
53
 
54
54
  test "should update last_logged_in_at without updating updated_at timestamp" do
55
- user = Factory(:user, :updated_at => 1.day.ago)
55
+ user = FactoryGirl.create(:user, :updated_at => 1.day.ago)
56
56
  updated_at = user.updated_at
57
57
  user.logged_in
58
58
  assert(user.updated_at == updated_at)
@@ -79,7 +79,7 @@ class AuthenticationTest < ActiveSupport::TestCase
79
79
  end
80
80
 
81
81
  test "should use latest digest version for new users" do
82
- assert_equal(User::PREFERRED_DIGEST_VERSION,Factory(:user).using_digest_version)
82
+ assert_equal(User::PREFERRED_DIGEST_VERSION,FactoryGirl.create(:user).using_digest_version)
83
83
  end
84
84
 
85
85
  test "should migrate legacy users to new digest version" do
@@ -9,13 +9,13 @@ class AuthorizationTest < ActiveSupport::TestCase
9
9
  end
10
10
 
11
11
  test "should return logged_in user for current_user" do
12
- user = Factory(:user)
12
+ user = FactoryGirl.create(:user)
13
13
  session[:user_id] = user.id
14
14
  assert_equal(user, current_user)
15
15
  end
16
16
 
17
17
  test "should pass authorization" do
18
- user = Factory(:user)
18
+ user = FactoryGirl.create(:user)
19
19
  session[:user_id] = user.id
20
20
  assert(authorization_required)
21
21
  end
data/test/factories.rb CHANGED
@@ -1,10 +1,12 @@
1
1
  module Factories
2
2
  salt = User.make_token
3
- Factory.define :user do |u|
4
- u.active true
5
- u.email 'test@testing.com'
6
- u.salt salt
7
- u.crypted_password User.secure_digest('password',salt,Minimalist::Authentication::PREFERRED_DIGEST_VERSION)
8
- u.using_digest_version Minimalist::Authentication::PREFERRED_DIGEST_VERSION
3
+ FactoryGirl.define do
4
+ factory :user do
5
+ active true
6
+ email 'test@testing.com'
7
+ salt salt
8
+ crypted_password User.secure_digest('password',salt,Minimalist::Authentication::PREFERRED_DIGEST_VERSION)
9
+ using_digest_version Minimalist::Authentication::PREFERRED_DIGEST_VERSION
10
+ end
9
11
  end
10
12
  end
@@ -8,14 +8,14 @@ class SessionsControllerTest < ActionController::TestCase
8
8
  end
9
9
 
10
10
  test "should create session" do
11
- user = Factory(:user)
11
+ user = FactoryGirl.create(:user)
12
12
  post :create, :email => 'test@testing.com', :password => 'password'
13
13
  assert_equal(user.id, session[:user_id])
14
14
  assert_redirected_to '/'
15
15
  end
16
16
 
17
17
  test "should fail to create session" do
18
- user = Factory(:user)
18
+ user = FactoryGirl.create(:user)
19
19
  post :create, :email => 'test@testing.com', :password => 'wrong_password'
20
20
  assert_nil(session[:user_id])
21
21
  assert_response :success
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimalist_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Baldwin
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 3.0.5
35
+ version: 3.2.14
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 3.0.5
42
+ version: 3.2.14
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: sqlite3
45
45
  requirement: !ruby/object:Gem::Requirement