Refactored functional test to use a function that will check for rows in a table