use variables from test setup

This commit is contained in:
Vijay Dev 2011-10-17 19:15:24 +05:30
parent 826a850696
commit 8dffc62a9b
1 changed files with 4 additions and 6 deletions

View File

@ -10,15 +10,13 @@ class SecurePasswordTest < ActiveModel::TestCase
end
test "blank password" do
user = User.new
user.password = ''
assert !user.valid?, 'user should be invalid'
@user.password = ''
assert !@user.valid?, 'user should be invalid'
end
test "nil password" do
user = User.new
user.password = nil
assert !user.valid?, 'user should be invalid'
@user.password = nil
assert !@user.valid?, 'user should be invalid'
end
test "password must be present" do