separated validation function
created and utilized test db fixture