Created
September 25, 2013 22:35
-
-
Save seth-macpherson/6707046 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './test/test_helper.rb' | |
require "password_policy" | |
class MyPasswordTest < ActiveSupport::TestCase | |
def test_min_length | |
password = "howdy" | |
policy = PasswordPolicy.new({:min_length => 6}) | |
assert_equal(false, policy.validate(password)) | |
assert(policy.errors.first =~ /Password must be at least 6/) | |
password += "extra-char" | |
assert policy.validate(password) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment