test: use MustNewRequest.
This commit is contained in:
parent
2223587fc0
commit
a1a0420314
7 changed files with 27 additions and 37 deletions
|
@ -4,8 +4,8 @@ import (
|
|||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/containous/traefik/testhelpers"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestReplacePath(t *testing.T) {
|
||||
|
@ -28,8 +28,7 @@ func TestReplacePath(t *testing.T) {
|
|||
}),
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(http.MethodGet, "http://localhost"+path, nil)
|
||||
require.NoError(t, err, "%s: unexpected error.", path)
|
||||
req := testhelpers.MustNewRequest(http.MethodGet, "http://localhost"+path, nil)
|
||||
|
||||
handler.ServeHTTP(nil, req)
|
||||
assert.Equal(t, expectedPath, replacementPath, "Unexpected path.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue