Skip to content

Commit

Permalink
feat(bindata): add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rande committed Mar 16, 2021
1 parent e88bf95 commit d803866
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/modules/bindata_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright © 2014-2021 Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package modules

import (
"net/http"
"net/http/httptest"
"testing"

. "github.com/rande/goapp"
"github.com/rande/gonode/test"
"github.com/stretchr/testify/assert"
)

func Test_BinData_404(t *testing.T) {
test.RunHttpTest(t, func(t *testing.T, ts *httptest.Server, app *App) {
auth := test.GetDefaultAuthHeader(ts)

res, _ := test.RunRequest("GET", ts.URL+"/explorer/error404", nil, auth)

assert.Equal(t, http.StatusNotFound, res.StatusCode)
assert.Equal(t, res.GetBody(), []byte("<html><head><title>Page not found</title></head><body><h1>Page not found</h1></body></html>"))
})
}

0 comments on commit d803866

Please sign in to comment.