From f01951917b99def139acab5a5bfe83afbbe01b24 Mon Sep 17 00:00:00 2001 From: Filip Figiel Date: Fri, 17 Aug 2018 09:33:22 +0200 Subject: [PATCH] Fix tests style --- context_test.go | 6 +++--- render/render_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/context_test.go b/context_test.go index 67f37dae..3e43ea89 100644 --- a/context_test.go +++ b/context_test.go @@ -575,9 +575,9 @@ func TestContextRenderJSON(t *testing.T) { w := httptest.NewRecorder() c, _ := CreateTestContext(w) - c.JSON(http.StatusCreated, H{"foo": "bar", "html": ""}) + c.JSON(201, H{"foo": "bar", "html": ""}) - assert.Equal(t, http.StatusCreated, w.Code) + assert.Equal(t, 201, w.Code) assert.Equal( t, "{\"foo\":\"bar\",\"html\":\"\\u003cb\\u003e\"}\n", @@ -591,7 +591,7 @@ func TestContextRenderJSON(t *testing.T) { func TestContextRenderPureJSON(t *testing.T) { c, w, _ := CreateTestContext() c.PureJSON(201, H{"foo": "bar", "html": ""}) - assert.Equal(t, w.Code, 201) + assert.Equal(t, 201, w.Code) assert.Equal(t, "{\"foo\":\"bar\",\"html\":\"\"}\n", w.Body.String()) assert.Equal(t, "application/json; charset=utf-8", w.HeaderMap.Get("Content-Type")) } diff --git a/render/render_test.go b/render/render_test.go index 88e227e8..a9e3ec2e 100644 --- a/render/render_test.go +++ b/render/render_test.go @@ -52,9 +52,9 @@ func TestRenderJSON(t *testing.T) { assert.Equal(t, "{\"foo\":\"bar\"}", w.Body.String()) assert.Equal( t, - w.Body.String(), - "{\"foo\":\"bar\",\"html\":\"\\u003cb\\u003e\"}\n") - assert.Equal(t, w.Header().Get("Content-Type"), "application/json; charset=utf-8") + "{\"foo\":\"bar\",\"html\":\"\\u003cb\\u003e\"}\n", + w.Body.String()) + assert.Equal(t, "application/json; charset=utf-8", w.Header().Get("Content-Type")) } func TestRenderPureJSON(t *testing.T) {