fix: add test
This commit is contained in:
parent
2d7451b36a
commit
a3e71a9f1c
1 changed files with 29 additions and 0 deletions
|
@ -263,6 +263,35 @@ func TestGlobalExternalAlwaysSetCookie(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestGlobalExternalDefaultEnable(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
defaultEnable string
|
||||
result bool
|
||||
}{
|
||||
"true": {
|
||||
defaultEnable: "true",
|
||||
result: true,
|
||||
},
|
||||
"false": {
|
||||
defaultEnable: "false",
|
||||
result: false,
|
||||
},
|
||||
"set empty": {
|
||||
defaultEnable: "",
|
||||
},
|
||||
"error": {
|
||||
defaultEnable: "error string",
|
||||
},
|
||||
}
|
||||
|
||||
for n, tc := range testCases {
|
||||
cfg := ReadConfig(map[string]string{"global-auth-default-enable": tc.defaultEnable})
|
||||
if cfg.GlobalAuthDefaultEnable != tc.result {
|
||||
t.Errorf("Testing %v. Expected \"%v\" but \"%v\" was returned", n, tc.result, cfg.GlobalAuthDefaultEnable)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGlobalExternalAuthSigninRedirectParamParsing(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
param string
|
||||
|
|
Loading…
Reference in a new issue