has_editable_password 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjE0YjFiMmY0YzBhMTk5YWUwMDAxNGJiMGEyZmY5OWJiYzY1NWE5OQ==
4
+ NWY1Mjc0ZDJhZDQyNzA0ZWMxNDNhMDdkMjgwNDRmODY2ZTU2NmQ3Ng==
5
5
  data.tar.gz: !binary |-
6
- MjE2MjYyZjA1NTRlYmUxZjE5MmQ2YTI2ZDUyOWNlZmFiYjUxOTc2Mw==
6
+ Njg3MmE4ZjVhM2RkNmU3ZWQxMjE5OTYxZDU5MjRkMWMyOWJmZDQyNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2U1MGQ0NDUxMzdjYmRlMWQzNGU4MGRmYmEwZTYzYWQ0NzhhYjdiMzRmMTNl
10
- OWRlZDZlYWRiY2VjOTRiNDYzYjBmMjZhZTZkZTMxMWQ1NDliMTNkZWUxNWVl
11
- YmU2NzI2ZWEzOGQ4OThkNmE2OTY0MmJmZjJlMjM4ZTljZmEwYjI=
9
+ MzBmMWFjNjljY2Y1Y2IzNzU0NDcyYjc0OWY2NTJjNjU3ZjBlOWNkNzczNjM5
10
+ YzYyZWQxZDQ5NzQ2ZTZmZjg3NDM1M2Y5NzM3MDY2N2EzNDU3YjdhM2M1MTdm
11
+ ZTNhZmFkYzZiNzk3NWE0MTRiMmQ4OTE0ZDBlNTdkOGQwYThhOTU=
12
12
  data.tar.gz: !binary |-
13
- ZDMyZTJhNmQ4YmFkZjY3NWZjMTdmYTFjZjIxMTU2MGY3ZDg3NWU3OGY3NDdl
14
- MWY5ZDc5MWJiYjYzMTBlMjMxOWE2MTVmMjljODMwZDgzNmY4YmY5YTAyYWJk
15
- ZjMzNTMxOWI4ZWNkN2ZiYjE1MGZlNTFmZDE3OTM0YmM5NTZkYmY=
13
+ YzUwMjRjOTYzZmRlYzA1NWZlM2Y0OWZmMmM4MDFjZDM5ODA5MWNiMjVmNDE0
14
+ NTMwMDYwYTAwZjMyYTNlYWFkNjZmZjc3ZTlkYzRiYjkzMmNlMjY3NmZhYmZj
15
+ NjNmNjYxNTkzNjNlYWYzMjJjMmM5NGVhYzE4Yjk3YmViZjRjODg=
@@ -19,6 +19,9 @@ module HasEditablePassword
19
19
 
20
20
  unless password_digest.blank? or password_digest_changed?
21
21
  self.previous_password_digest = password_digest if respond_to? :previous_password_digest=
22
+ end
23
+
24
+ unless password_digest_changed?
22
25
  self.password_digest_updated = Time.now if respond_to? :password_digest_updated=
23
26
  end
24
27
 
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION = '0.1.0'
1
+ VERSION = '0.1.1'
@@ -51,6 +51,10 @@ describe HasEditablePassword do
51
51
  end
52
52
 
53
53
  context 'password_digest_updated= exists' do
54
+ it 'sets password_digest_updated on create too' do
55
+ expect(user.password_digest_updated).to_not be_nil
56
+ end
57
+
54
58
  it 'sets the password_digest_updated field' do
55
59
  expect(user).to receive(:password_digest_updated=)
56
60
  user.password = 'new_secret'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_editable_password
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Boffa