Browse Source

Optimize tests, rename var

Volodymyr Tkach 2 years ago
parent
commit
2b4eb4b3fa
1 changed files with 4 additions and 4 deletions
  1. 4 4
      utils/http/helpers/helpers_test.go

+ 4 - 4
utils/http/helpers/helpers_test.go

@@ -271,13 +271,13 @@ var _ = Describe("helpers", func() {
 
 		Context("RespondAsBadRequest", func() {
 			BeforeEach(func() {
-				var getTestHandler = func() http.HandlerFunc {
+				var handler = func() http.HandlerFunc {
 					return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 						helpers.RespondAsBadRequest(w, r, fmt.Errorf("MyError"))
 					})
 				}
 
-				srv = httptest.NewServer(getTestHandler())
+				srv = httptest.NewServer(handler())
 				client = srv.Client()
 				resp, err = client.Get(srv.URL + "/")
 				Expect(err).To(Succeed())
@@ -301,13 +301,13 @@ var _ = Describe("helpers", func() {
 
 		Context("RespondAsMethodNotAllowed", func() {
 			BeforeEach(func() {
-				var getTestHandler = func() http.HandlerFunc {
+				var handler = func() http.HandlerFunc {
 					return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 						helpers.RespondAsMethodNotAllowed(w, r)
 					})
 				}
 
-				srv = httptest.NewServer(getTestHandler())
+				srv = httptest.NewServer(handler())
 				client = srv.Client()
 				resp, err = client.Get(srv.URL + "/")
 				Expect(err).To(Succeed())