Refactor HTTP status code handling tests to make them simpler and more readable