test that validation is applied properly