{"action":"created","issue":{"url":"https://api.github.com/repos/gin-gonic/gin/issues/324","labels_url":"https://api.github.com/repos/gin-gonic/gin/issues/324/labels{/name}","comments_url":"https://api.github.com/repos/gin-gonic/gin/issues/324/comments","events_url":"https://api.github.com/repos/gin-gonic/gin/issues/324/events","html_url":"https://github.com/gin-gonic/gin/pull/324","id":84194327,"number":324,"title":"Exporting CreateTestContext","user":{"login":"danielalves","id":522602,"avatar_url":"https://avatars.githubusercontent.com/u/522602?v=3","gravatar_id":"","url":"https://api.github.com/users/danielalves","html_url":"https://github.com/danielalves","followers_url":"https://api.github.com/users/danielalves/followers","following_url":"https://api.github.com/users/danielalves/following{/other_user}","gists_url":"https://api.github.com/users/danielalves/gists{/gist_id}","starred_url":"https://api.github.com/users/danielalves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielalves/subscriptions","organizations_url":"https://api.github.com/users/danielalves/orgs","repos_url":"https://api.github.com/users/danielalves/repos","events_url":"https://api.github.com/users/danielalves/events{/privacy}","received_events_url":"https://api.github.com/users/danielalves/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-06-02T20:20:55Z","updated_at":"2016-01-14T14:27:33Z","closed_at":"2015-10-02T08:27:21Z","pull_request":{"url":"https://api.github.com/repos/gin-gonic/gin/pulls/324","html_url":"https://github.com/gin-gonic/gin/pull/324","diff_url":"https://github.com/gin-gonic/gin/pull/324.diff","patch_url":"https://github.com/gin-gonic/gin/pull/324.patch"},"body":"closes #323 "},"comment":{"url":"https://api.github.com/repos/gin-gonic/gin/issues/comments/171657238","html_url":"https://github.com/gin-gonic/gin/pull/324#issuecomment-171657238","issue_url":"https://api.github.com/repos/gin-gonic/gin/issues/324","id":171657238,"user":{"login":"awishformore","id":3630494,"avatar_url":"https://avatars.githubusercontent.com/u/3630494?v=3","gravatar_id":"","url":"https://api.github.com/users/awishformore","html_url":"https://github.com/awishformore","followers_url":"https://api.github.com/users/awishformore/followers","following_url":"https://api.github.com/users/awishformore/following{/other_user}","gists_url":"https://api.github.com/users/awishformore/gists{/gist_id}","starred_url":"https://api.github.com/users/awishformore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awishformore/subscriptions","organizations_url":"https://api.github.com/users/awishformore/orgs","repos_url":"https://api.github.com/users/awishformore/repos","events_url":"https://api.github.com/users/awishformore/events{/privacy}","received_events_url":"https://api.github.com/users/awishformore/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T14:27:33Z","updated_at":"2016-01-14T14:27:33Z","body":"Honestly, I understand all the points made about testing middleware and how this is not the right approach, but I disagree with the point made in the other thread about separating the business logic from the controllers.\r\n\r\nThe controllers are the business logic. If I separate the business logic from the controllers, how will I be able to give adequate HTTP error codes in my API responses? There should be a way to create a context from a given request (not possible right now), run the handler on that context (already possible) and then extract the response from the context (already possible).\r\n\r\nWithout these three puzzle pieces, it's not possible to do proper testing on your web projects. When using the standard http library, there are no such issues. Even with this change, it will not be straight forward, which it should be."}}