mirror of
https://github.com/volatiletech/authboss.git
synced 2024-11-28 08:58:38 +02:00
fa6ba517db
- Change response to be more central to Authboss. Make sure it has useful methods and works with the new rendering idioms. - Change the load user methods to all work with context keys, and even be able to set context keys on the current request to avoid setting contexts everywhere in the code base.
27 lines
498 B
Go
27 lines
498 B
Go
package authboss
|
|
|
|
import "testing"
|
|
|
|
func TestCasingStyleConversions(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
tests := []struct {
|
|
In string
|
|
Out string
|
|
}{
|
|
{"SomethingInCamel", "something_in_camel"},
|
|
{"Oauth2Anything", "oauth2_anything"},
|
|
}
|
|
|
|
for i, test := range tests {
|
|
out := camelToUnder(test.In)
|
|
if out != test.Out {
|
|
t.Errorf("%d) Expected %q got %q", i, test.Out, out)
|
|
}
|
|
out = underToCamel(out)
|
|
if out != test.In {
|
|
t.Errorf("%d), Expected %q got %q", i, test.In, out)
|
|
}
|
|
}
|
|
}
|