authpwn_rails 0.14.2 → 0.14.3
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/models/credentials/email.rb +1 -1
- data/authpwn_rails.gemspec +1 -1
- data/test/credentials/email_credential_test.rb +2 -1
- data/test/user_extensions/email_field_test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc8216974a3bf1143ac13b338b9c4037075138f5
|
4
|
+
data.tar.gz: 436967faedbd3db9e2914686e72c25e7bff9efe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b86272b9f314929400ea85547a975c0ac168ae096dcc90a8d1dbecbe58be456068d5df8103ac0c26581ceac0832ce06a0258efec03a65b8546513695734c1ed5
|
7
|
+
data.tar.gz: 114d8a0a0baabd93f021c11ff05d174b9d92e41a929ac7532ea568b9c9a7f65cbafa5c9bc0610cf5ffa0af5d95fb2b38382c696944ea9180c28c8ed6484120c7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.14.
|
1
|
+
0.14.3
|
@@ -20,7 +20,7 @@ class Email < ::Credential
|
|
20
20
|
alias_attribute :email, :name
|
21
21
|
validates :name, format: /\A[A-Za-z0-9.+_]+@[^@]*\.(\w+)\Z/,
|
22
22
|
presence: true, length: 1..128, uniqueness: { scope: [:type],
|
23
|
-
message: '
|
23
|
+
message: 'is already used by another account' }
|
24
24
|
|
25
25
|
# '1' if the user proved ownership of the e-mail address.
|
26
26
|
validates :key, presence: true, inclusion: { in: ['0', '1'] }
|
data/authpwn_rails.gemspec
CHANGED
@@ -62,7 +62,8 @@ class EmailCredentialTest < ActiveSupport::TestCase
|
|
62
62
|
test 'email uniqueness' do
|
63
63
|
@credential.email = credentials(:john_email).email
|
64
64
|
assert !@credential.valid?
|
65
|
-
assert @credential.errors[:name].
|
65
|
+
assert @credential.errors[:name].
|
66
|
+
any? { |m| /already used by another/i =~ m },
|
66
67
|
'Validation errors include custom uniqueness error'
|
67
68
|
assert !@credential.errors[:name].
|
68
69
|
any? { |m| m == 'has already been taken' },
|
@@ -50,7 +50,7 @@ class EmailFieldTest < ActiveSupport::TestCase
|
|
50
50
|
@user.email = @john.email
|
51
51
|
assert !@user.valid?, 'Using existent e-mail'
|
52
52
|
assert_not_nil @user.errors[:email], 'No validation errors on e-mail'
|
53
|
-
assert @user.errors[:email].any? { |m| /already
|
53
|
+
assert @user.errors[:email].any? { |m| /already used by another/i =~ m },
|
54
54
|
'E-mail validation errors include uniqueness error'
|
55
55
|
end
|
56
56
|
|