Massad / gin-boilerplate

The fastest way to deploy a restful api's with Gin Framework with a structured project that defaults to PostgreSQL database and JWT authentication middleware stored in Redis
MIT License
1.07k stars 193 forks source link

Doesnt hit the create article endpoint #9

Closed h4ck3rk3y closed 4 years ago

h4ck3rk3y commented 4 years ago

https://github.com/Massad/gin-boilerplate/blob/19bc7539f80228bbbffbe5d95ccc97b94dc71ed4/tests/article_test.go#L377-L398

Massad commented 4 years ago

Screen Shot 2020-05-24 at 3 05 08 PM

It does reach it, can you please explain more?

h4ck3rk3y commented 4 years ago

Oh sorry I was a bit confused because of the name TestCreateArticleUnauthorized. I was expecting a POST request to the /v1/article endpoint with an invalid token. This is a Get request though. TestGetArticleUnauthorized might be a better name?

Massad commented 4 years ago

You are absolutely correct! At first it was for "Creation" but then changed to "Get" because doesn't make sense to validate it post with body request... GET is less code.

Changed it here https://github.com/Massad/gin-boilerplate/commit/38835a58592b37980589806e56faaa720cde63ed