Specifying the Requirement for the Route Handler With a Unit Test
The test for the handler of this route will check for the following conditions:
- The handler responds with an HTTP status code of 200,
- The returned HTML contains a title tag containing the title of the article that was fetched.
The code for the test will be placed in the TestArticleUnauthenticated
function in the handlers.article_test.go
file. We will place helper functions used by this function in the common_test.go
file.