Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 08ccd29b5b
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (23 sloc) 0.625 kb
require 'cases/helper'
require 'models/user'
class SecurePasswordTest < ActiveModel::TestCase
setup do
@user = User.new
end
test "password must be present" do
assert !@user.valid?
assert_equal 1, @user.errors.size
end
test "password must match confirmation" do
@user.password = "thiswillberight"
@user.password_confirmation = "wrong"
assert !@user.valid?
@user.password_confirmation = "thiswillberight"
assert @user.valid?
end
test "authenticate" do
@user.password = "secret"
assert !@user.authenticate("wrong")
assert @user.authenticate("secret")
end
end
Jump to Line
Something went wrong with that request. Please try again.