added tests for post requests and forms
refactor functional test using helper function