badguardhome/internal/dhcpd/http_test.go
Ainar Garipov 10f03b7527 Pull request: dhcpd: assume static ip on eperm
Merge in DNS/adguard-home from 2667-eperm-dhcp to master

Updates #2667.

Squashed commit of the following:

commit 7fad607ae0ae75419005707ee58312bc64fe78c5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Feb 12 16:27:59 2021 +0300

    dhcpd: assume static ip on eperm
2021-02-12 16:40:34 +03:00

24 lines
487 B
Go

package dhcpd
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestServer_notImplemented(t *testing.T) {
s := &Server{}
h := s.notImplemented("never!")
w := httptest.NewRecorder()
r, err := http.NewRequest(http.MethodGet, "/unsupported", nil)
require.Nil(t, err)
h(w, r)
assert.Equal(t, http.StatusNotImplemented, w.Code)
assert.Equal(t, `{"message":"never!"}`+"\n", w.Body.String())
}