Writing the functional test