authn 3.1.4 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/authn/version.rb +1 -1
- data/test/helper.rb +0 -1
- data/test/lib/authn/model_test.rb +21 -21
- metadata +4 -6
- data/test/lib/authn/version_test.rb +0 -8
data/lib/authn/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -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
|
-
|
18
|
-
|
31
|
+
expected = "Account"
|
32
|
+
actual = Account.config.account_klass
|
19
33
|
assert_equal expected, actual
|
20
34
|
end
|
21
35
|
|
22
|
-
def
|
23
|
-
|
24
|
-
|
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
|
-
|
51
|
-
|
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.
|
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-
|
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: -
|
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: -
|
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:
|