refactor the tests using a mock_app method instead of creating files!