summaryrefslogtreecommitdiffstats
path: root/model/utils_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-12-10 08:54:12 -0500
committerChristopher Speller <crspeller@gmail.com>2015-12-10 08:54:12 -0500
commitaef16866066c8fec2529e57a9659fd3cb03acc91 (patch)
treee92ccc3cb3335238bf9b7fd376dea71454e4a1fc /model/utils_test.go
parent415276fa6a1af933a8b9b8f71afa81e36d9e0b13 (diff)
parent7299fd6a4c6a658b378e4df12468d302ff6a7512 (diff)
downloadchat-aef16866066c8fec2529e57a9659fd3cb03acc91.tar.gz
chat-aef16866066c8fec2529e57a9659fd3cb03acc91.tar.bz2
chat-aef16866066c8fec2529e57a9659fd3cb03acc91.zip
Merge pull request #1688 from mattermost/fix-salts
Generate salts when empty
Diffstat (limited to 'model/utils_test.go')
-rw-r--r--model/utils_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/model/utils_test.go b/model/utils_test.go
index 7f14bcdf0..1f1e5f023 100644
--- a/model/utils_test.go
+++ b/model/utils_test.go
@@ -17,6 +17,15 @@ func TestNewId(t *testing.T) {
}
}
+func TestRandomString(t *testing.T) {
+ for i := 0; i < 1000; i++ {
+ r := NewRandomString(32)
+ if len(r) != 32 {
+ t.Fatal("should be 32 chars")
+ }
+ }
+}
+
func TestAppError(t *testing.T) {
err := NewAppError("TestAppError", "message", "")
json := err.ToJson()