Permalink
Browse files

Add test support for new validations

  • Loading branch information...
1 parent 495dfe1 commit 3196c75461a8d77deacce7c59b102ed7137d3451 @bnauta bnauta committed Nov 14, 2013
Showing with 12 additions and 3 deletions.
  1. +12 −3 test/acts_as_authentic_test/password_test.rb
@@ -111,16 +111,25 @@ 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
u = User.new
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

0 comments on commit 3196c75

Please sign in to comment.