mini_auth 0.3.0.beta3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,7 @@
3
3
  * Add the class method `token` that defines "generate_#{name}_token" and
4
4
  "verify_#{name}_token" methods dynamically.
5
5
  * Remove the deprecation warnings in Rails 3.2.0.rc1
6
+ * Unset `changing_password` and `setting_password` after the object is saved.
6
7
 
7
8
  ## 0.2.0 (2011-12-19)
8
9
 
data/README.md CHANGED
@@ -44,7 +44,7 @@ Synopsis
44
44
  end
45
45
 
46
46
  a = User.new(:name => "alice", :password => "hotyoga")
47
- a.setting_password => true
47
+ a.setting_password = true
48
48
 
49
49
  a.save # => true
50
50
  a.password_digest # => "$2a$10$F5YbEd..."
@@ -49,6 +49,8 @@ module MiniAuth
49
49
 
50
50
  after_save do
51
51
  self.password = nil
52
+ self.changing_password = false
53
+ self.setting_password = false
52
54
  end
53
55
  end
54
56
 
@@ -1,3 +1,3 @@
1
1
  module MiniAuth
2
- VERSION = "0.3.0.beta3"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.name = "mini_auth"
6
6
  s.version = MiniAuth::VERSION
7
7
  s.authors = ["Tsutomu Kuroda"]
8
- s.email = ["t-kuroda@oiax.jp"]
9
- s.homepage = ""
8
+ s.email = ["hermes@oiax.jp"]
9
+ s.homepage = "https://github.com/kuroda/mini_auth"
10
10
  s.summary = %q{A minimal authentication module for Rails}
11
11
  s.description = %q{A minimal authentication module for Rails}
12
12
 
@@ -8,12 +8,18 @@ describe "change_password" do
8
8
  u.changing_password = true
9
9
  u
10
10
  end
11
-
11
+
12
12
  it "should change password" do
13
13
  user.update_attributes(:current_password => 'password', :new_password => 'banana')
14
14
 
15
15
  user.authenticate('banana').should be_true
16
16
  end
17
+
18
+ it "should unset changing_password flag afterwards" do
19
+ user.update_attributes(:current_password => 'password', :new_password => 'banana')
20
+
21
+ user.changing_password.should be_false
22
+ end
17
23
 
18
24
  it "should reject wrong current password" do
19
25
  user.assign_attributes(:current_password => 'lemon', :new_password => 'banana')
@@ -10,7 +10,7 @@ describe "setting_password" do
10
10
  v = User.find_by_name('alice')
11
11
  v.authenticate('hotyoga').should be_true
12
12
  end
13
-
13
+
14
14
  it "should update password" do
15
15
  u = User.create!(:name => 'alice')
16
16
  u.setting_password = true
@@ -18,6 +18,13 @@ describe "setting_password" do
18
18
  u.authenticate('hotyoga').should be_true
19
19
  end
20
20
 
21
+ it "should unset setting_password flag afterwards" do
22
+ u = User.create!(:name => 'alice')
23
+ u.setting_password = true
24
+ u.update_attributes(:password => 'hotyoga')
25
+ u.setting_password.should be_false
26
+ end
27
+
21
28
  it "should reject blank password" do
22
29
  u = User.new(:name => 'alice', :password => '')
23
30
  u.setting_password = true
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.beta3
5
- prerelease: 6
4
+ version: 0.3.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tsutomu Kuroda
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-20 00:00:00.000000000 Z
12
+ date: 2011-12-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &16157860 !ruby/object:Gem::Requirement
16
+ requirement: &14412040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *16157860
24
+ version_requirements: *14412040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bcrypt-ruby
27
- requirement: &19015300 !ruby/object:Gem::Requirement
27
+ requirement: &14411540 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *19015300
35
+ version_requirements: *14411540
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &19014260 !ruby/object:Gem::Requirement
38
+ requirement: &14411080 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.7.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *19014260
46
+ version_requirements: *14411080
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sqlite3
49
- requirement: &19013300 !ruby/object:Gem::Requirement
49
+ requirement: &14410620 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.3.4
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *19013300
57
+ version_requirements: *14410620
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: database_cleaner
60
- requirement: &19012480 !ruby/object:Gem::Requirement
60
+ requirement: &14410160 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.7.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *19012480
68
+ version_requirements: *14410160
69
69
  description: A minimal authentication module for Rails
70
70
  email:
71
- - t-kuroda@oiax.jp
71
+ - hermes@oiax.jp
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
@@ -90,7 +90,7 @@ files:
90
90
  - spec/mini_auth/token_spec.rb
91
91
  - spec/spec_helper.rb
92
92
  - test_on_multiple_environments.sh
93
- homepage: ''
93
+ homepage: https://github.com/kuroda/mini_auth
94
94
  licenses: []
95
95
  post_install_message:
96
96
  rdoc_options: []
@@ -105,9 +105,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
- - - ! '>'
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
- version: 1.3.1
110
+ version: '0'
111
111
  requirements: []
112
112
  rubyforge_project: mini_auth
113
113
  rubygems_version: 1.8.10