learn-co-curriculum / sinatra-secure-password-lab

Other
0 stars 397 forks source link

False Positive on Spec #4 #14

Closed RMcNeely closed 8 years ago

RMcNeely commented 8 years ago

Tests can pass where the User can access the Login page from signup without a valid password if they leave the field blank.

if (@user.username != "" ? true : false ) && (@user.password != "" ? true : false ) @user.save redirect to '/login' end redirect to '/failure'

Will pass the tests even if the field is blank because it will evaluate as true.