Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xplodwild committed Mar 22, 2020
1 parent be31c2b commit 4f5133c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (

HeaderAuthorization = "Authorization"
HeaderContentType = "Content-Type"
HeaderContentDisposition = "ContentDisposition"
HeaderContentDisposition = "Content-Disposition"

AbortMiddlewareIndex = math.MaxInt8 / 2
)
4 changes: 2 additions & 2 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func TestDownloadResp(t *testing.T) {
a.ServeHTTP(w, r)
ass.Equal(200, w.Code)
ass.Equal("123", w.Body.String())
ass.Equal("application/octet-stream; charset=UTF-8", w.Header().Get("Content-Type"))
ass.Equal("attachment; filename=\"test.txt\"", w.Header().Get("Content-Disposition"))
ass.Equal("application/octet-stream; charset=UTF-8", w.Header().Get(HeaderContentType))
ass.Equal("attachment; filename=\"test.txt\"", w.Header().Get(HeaderContentDisposition))
}

func TestCData(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestSession(t *testing.T) {
test2 := session.GetInt("test2", 0)

assert.Equal(t, "123", test1)
assert.Equal(t, 123, test2)
assert.Equal(t, int64(123), test2)
c.String(200, "")
})

Expand Down
2 changes: 1 addition & 1 deletion sessions/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (t *SessionManagerSuite) TestSession() {

t.False(session.IsNew)
t.Equal("abc", session.GetString("foo", ""))
t.Equal(123, session.GetInt("baz", 0))
t.Equal(int64(123), session.GetInt("baz", 0))
t.Equal([]string{"1", "2", "3"}, session.GetStrings("test", nil))
t.Equal([]int64{1, 2, 3}, session.GetInts("test2", nil))
t.Equal(true, session.GetBool("bool", false))
Expand Down

0 comments on commit 4f5133c

Please sign in to comment.