Skip to content

Commit

Permalink
chore: update 200 to http.StatusOK
Browse files Browse the repository at this point in the history
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Feb 12, 2020
1 parent 26292a6 commit 788e784
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tester/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func GetSet(t *testing.T, newStore storeFactory) {
session := sessions.Default(c)
session.Set("key", ok)
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

r.GET("/get", func(c *gin.Context) {
Expand All @@ -40,7 +40,7 @@ func GetSet(t *testing.T, newStore storeFactory) {
t.Error("Session writing failed")
}
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

res1 := httptest.NewRecorder()
Expand All @@ -61,14 +61,14 @@ func DeleteKey(t *testing.T, newStore storeFactory) {
session := sessions.Default(c)
session.Set("key", ok)
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

r.GET("/delete", func(c *gin.Context) {
session := sessions.Default(c)
session.Delete("key")
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

r.GET("/get", func(c *gin.Context) {
Expand All @@ -77,7 +77,7 @@ func DeleteKey(t *testing.T, newStore storeFactory) {
t.Error("Session deleting failed")
}
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

res1 := httptest.NewRecorder()
Expand Down Expand Up @@ -107,7 +107,7 @@ func Flashes(t *testing.T, newStore storeFactory) {
session := sessions.Default(c)
session.AddFlash(ok)
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

r.GET("/flash", func(c *gin.Context) {
Expand All @@ -117,7 +117,7 @@ func Flashes(t *testing.T, newStore storeFactory) {
t.Error("Flashes count does not equal 1. Equals ", l)
}
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

r.GET("/check", func(c *gin.Context) {
Expand All @@ -127,7 +127,7 @@ func Flashes(t *testing.T, newStore storeFactory) {
t.Error("flashes count is not 0 after reading. Equals ", l)
}
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

res1 := httptest.NewRecorder()
Expand Down Expand Up @@ -161,7 +161,7 @@ func Clear(t *testing.T, newStore storeFactory) {
}
session.Clear()
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

r.GET("/check", func(c *gin.Context) {
Expand All @@ -172,7 +172,7 @@ func Clear(t *testing.T, newStore storeFactory) {
}
}
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

res1 := httptest.NewRecorder()
Expand Down Expand Up @@ -200,13 +200,13 @@ func Options(t *testing.T, newStore storeFactory) {
Path: "/foo/bar/bat",
})
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})
r.GET("/path", func(c *gin.Context) {
session := sessions.Default(c)
session.Set("key", ok)
session.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

testOptionSameSitego(t, r)
Expand Down Expand Up @@ -245,7 +245,7 @@ func Many(t *testing.T, newStore storeFactory) {
sessionB := sessions.DefaultMany(c, "b")
sessionB.Set("foo", "bar")
sessionB.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

r.GET("/get", func(c *gin.Context) {
Expand All @@ -260,7 +260,7 @@ func Many(t *testing.T, newStore storeFactory) {
t.Error("Session writing failed")
}
sessionB.Save()
c.String(200, ok)
c.String(http.StatusOK, ok)
})

res1 := httptest.NewRecorder()
Expand Down

0 comments on commit 788e784

Please sign in to comment.