Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test support for new validations

  • Loading branch information...
commit 3196c75461a8d77deacce7c59b102ed7137d3451 1 parent 495dfe1
@bnauta bnauta authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 test/acts_as_authentic_test/password_test.rb
View
15 test/acts_as_authentic_test/password_test.rb
@@ -111,7 +111,12 @@ def test_validates_length_of_password
u.password = "test"
assert !u.valid?
- assert u.errors[:password_confirmation].size == 0
+
+ if ActiveModel.respond_to?(:version) and ActiveModel.version.segments.first >= 4
+ assert u.errors[:password_confirmation].size == 5
+ else
+ assert u.errors[:password_confirmation].size == 0
+ end
end
def test_validates_confirmation_of_password
@@ -119,8 +124,12 @@ def test_validates_confirmation_of_password
u.password = "test"
u.password_confirmation = "test2"
assert !u.valid?
- assert u.errors[:password].size > 0
-
+# assert u.errors[:password].size > 0
+ if ActiveModel.respond_to?(:version) and ActiveModel.version.segments.first >= 4
+ assert u.errors[:password_confirmation].size > 0
+ else
+ assert u.errors[:password].size > 0
+ end
u.password_confirmation = "test"
assert !u.valid?
assert u.errors[:password].size == 0
Please sign in to comment.
Something went wrong with that request. Please try again.