open-vault/http/help_test.go
Mitchell Hashimoto 020af2fac2 http: help
2015-04-02 22:26:45 -07:00

28 lines
524 B
Go

package http
import (
"net/http"
"testing"
"github.com/hashicorp/vault/vault"
)
func TestHelp(t *testing.T) {
core, _, token := vault.TestCoreUnsealed(t)
ln, addr := TestServer(t, core)
defer ln.Close()
TestServerAuth(t, addr, token)
resp, err := http.Get(addr + "/v1/sys/mounts?help=1")
if err != nil {
t.Fatalf("err: %s", err)
}
var actual map[string]interface{}
testResponseStatus(t, resp, 200)
testResponseBody(t, resp, &actual)
if _, ok := actual["help"]; !ok {
t.Fatalf("bad: %#v", actual)
}
}