diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-04-19 15:38:35 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-04-19 15:38:35 -0400 |
commit | 0b919a324adeebd2f4ef6f250188752176ffe63f (patch) | |
tree | 367a07677e658518506064d7cb4107516e5e9711 /api4/user_test.go | |
parent | bc906abd6672efbe9b755a4edd5dbc5f7a39761f (diff) | |
download | chat-0b919a324adeebd2f4ef6f250188752176ffe63f.tar.gz chat-0b919a324adeebd2f4ef6f250188752176ffe63f.tar.bz2 chat-0b919a324adeebd2f4ef6f250188752176ffe63f.zip |
Don't sanitize returned user when updating a user (#6095)
* Don't sanitize returned user when updating a user
* Use user model function for clearing private data
Diffstat (limited to 'api4/user_test.go')
-rw-r--r-- | api4/user_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api4/user_test.go b/api4/user_test.go index d044cee9b..9a360c7e4 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -739,6 +739,8 @@ func TestPatchUser(t *testing.T) { patch.LastName = new(string) *patch.LastName = "Wilander" patch.Position = new(string) + patch.NotifyProps = model.StringMap{} + patch.NotifyProps["comment"] = "somethingrandom" ruser, resp := Client.PatchUser(user.Id, patch) CheckNoError(t, resp) @@ -759,6 +761,9 @@ func TestPatchUser(t *testing.T) { if ruser.Username != user.Username { t.Fatal("Username should not have updated") } + if ruser.NotifyProps["comment"] != "somethingrandom" { + t.Fatal("NotifyProps did not update properly") + } _, resp = Client.PatchUser("junk", patch) CheckBadRequestStatus(t, resp) |