authn 3.1.4 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/authn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module AuthN
2
- VERSION = "3.1.4"
2
+ VERSION = "3.5.0"
3
3
  end
data/test/helper.rb CHANGED
@@ -25,7 +25,6 @@ end
25
25
  class Account
26
26
  include ActiveModel::Model
27
27
  include AuthN::Model
28
- has_authentication
29
28
  has_secure_password
30
29
  attr_accessor :password_digest
31
30
 
@@ -3,9 +3,23 @@ require 'helper'
3
3
 
4
4
  class TestAuthNModel < MiniTest::Unit::TestCase
5
5
  def setup
6
+ Account.has_authentication
6
7
  @account = Account.new
7
8
  end
8
9
 
10
+ # def config=(options)
11
+ # @@config = options
12
+ # end
13
+ #
14
+ # def config
15
+ # @@config ||= AuthN::Config.new
16
+ # end
17
+ def test_model_has_class_wide_config_settings
18
+ expected = AuthN::Config
19
+ actual = Account.config.class
20
+ assert_equal expected, actual
21
+ end
22
+
9
23
  # def has_authentication(options = {})
10
24
  # merge_config_with options
11
25
  # end
@@ -14,27 +28,14 @@ class TestAuthNModel < MiniTest::Unit::TestCase
14
28
  end
15
29
 
16
30
  def test_has_authentication_config_combinds_with_default_config
17
- actual =
18
- expected =
31
+ expected = "Account"
32
+ actual = Account.config.account_klass
19
33
  assert_equal expected, actual
20
34
  end
21
35
 
22
- def test_has_autehntication_config_merges_in_model_config
23
- actual =
24
- expected =
25
- assert_equal expected, actual
26
- end
27
-
28
- # def config=(options)
29
- # @@config = options
30
- # end
31
- #
32
- # def config
33
- # @@config ||= AuthN::Config.new
34
- # end
35
- def test_model_has_class_wide_config_settings
36
- actual =
37
- expected =
36
+ def test_has_authentication_config_merges_into_model_config
37
+ expected = "User"
38
+ actual = Account.tap { |a| a.has_authentication account_klass: "User" }.config.account_klass
38
39
  assert_equal expected, actual
39
40
  end
40
41
 
@@ -47,9 +48,8 @@ class TestAuthNModel < MiniTest::Unit::TestCase
47
48
  # end
48
49
  # end
49
50
  def test_authenticate_returns_instance_if_given_good_credentials
50
- actual =
51
- expected =
52
- assert_equal expected, actual
51
+ Account.password "12341234"
52
+ assert Account.authenticate(email: "kurtis@example.com", password: "12341234").is_a? Account
53
53
  end
54
54
 
55
55
  def test_authenticate_returns_false_if_bad_password
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authn
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.4
4
+ version: 3.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-07 00:00:00.000000000 Z
12
+ date: 2012-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -116,7 +116,6 @@ files:
116
116
  - test/lib/authn/config_test.rb
117
117
  - test/lib/authn/model_test.rb
118
118
  - test/lib/authn/session_test.rb
119
- - test/lib/authn/version_test.rb
120
119
  - test/lib/authn_test.rb
121
120
  homepage: http://krainboltgreene.github.com/authn
122
121
  licenses: []
@@ -132,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
131
  version: '0'
133
132
  segments:
134
133
  - 0
135
- hash: -2865134092982573588
134
+ hash: -1477380080716510232
136
135
  required_rubygems_version: !ruby/object:Gem::Requirement
137
136
  none: false
138
137
  requirements:
@@ -141,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
140
  version: '0'
142
141
  segments:
143
142
  - 0
144
- hash: -2865134092982573588
143
+ hash: -1477380080716510232
145
144
  requirements: []
146
145
  rubyforge_project:
147
146
  rubygems_version: 1.8.24
@@ -153,6 +152,5 @@ test_files:
153
152
  - test/lib/authn/config_test.rb
154
153
  - test/lib/authn/model_test.rb
155
154
  - test/lib/authn/session_test.rb
156
- - test/lib/authn/version_test.rb
157
155
  - test/lib/authn_test.rb
158
156
  has_rdoc:
@@ -1,8 +0,0 @@
1
- require 'minitest/autorun'
2
- require 'helper'
3
-
4
- class TestAuthNVersion < MiniTest::Unit::TestCase
5
- def test_that_version_is_latest
6
- assert_equal "3.1.4", AuthN::VERSION
7
- end
8
- end