Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
magiconair committed Feb 2, 2018
1 parent 6738ce8 commit 8bd4d2e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion admin/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"net/http"
"net/http/httptest"
"testing"

"github.com/fabiolb/fabio/config"
)

func TestAdminServerAccess(t *testing.T) {
Expand All @@ -13,7 +15,16 @@ func TestAdminServerAccess(t *testing.T) {
}

testAccess := func(access string, tests []test) {
srv := &Server{Access: access}
srv := &Server{
Access: access,
Cfg: &config.Config{
Registry: config.Registry{
Consul: config.Consul{
KVPath: "/fabio/config",
},
},
},
}
ts := httptest.NewServer(srv.handler())
defer ts.Close()

Expand All @@ -37,6 +48,7 @@ func TestAdminServerAccess(t *testing.T) {

roTests := []test{
{"/api/manual", 403},
{"/api/paths", 403},
{"/api/config", 200},
{"/api/routes", 200},
{"/api/version", 200},
Expand All @@ -49,6 +61,7 @@ func TestAdminServerAccess(t *testing.T) {

rwTests := []test{
{"/api/manual", 200},
{"/api/paths", 200},
{"/api/config", 200},
{"/api/routes", 200},
{"/api/version", 200},
Expand Down

0 comments on commit 8bd4d2e

Please sign in to comment.