summaryrefslogtreecommitdiffstats
path: root/api4/status_test.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-09-14 16:21:05 +0100
committerChristopher Speller <crspeller@gmail.com>2018-09-14 08:21:05 -0700
commitfdbb6de3d52a5f41f075812e3b87616685a21b9b (patch)
tree1e434c28bf56b82148124f15958f36423e02828c /api4/status_test.go
parent83a00ae9251475b3ef39284ba922cb3ca55a6fbe (diff)
downloadchat-fdbb6de3d52a5f41f075812e3b87616685a21b9b.tar.gz
chat-fdbb6de3d52a5f41f075812e3b87616685a21b9b.tar.bz2
chat-fdbb6de3d52a5f41f075812e3b87616685a21b9b.zip
MM-11520: Make entity ID checks consistent across api4. (#9395)
* MM-11520: Make entity ID checks consistent across api4. * Update tests.
Diffstat (limited to 'api4/status_test.go')
-rw-r--r--api4/status_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/api4/status_test.go b/api4/status_test.go
index afff8526d..ddfc879ae 100644
--- a/api4/status_test.go
+++ b/api4/status_test.go
@@ -121,7 +121,7 @@ func TestUpdateUserStatus(t *testing.T) {
defer th.TearDown()
Client := th.Client
- toUpdateUserStatus := &model.Status{Status: "online"}
+ toUpdateUserStatus := &model.Status{Status: "online", UserId: th.BasicUser.Id}
updateUserStatus, resp := Client.UpdateUserStatus(th.BasicUser.Id, toUpdateUserStatus)
CheckNoError(t, resp)
if updateUserStatus.Status != "online" {
@@ -150,6 +150,7 @@ func TestUpdateUserStatus(t *testing.T) {
}
toUpdateUserStatus.Status = "online"
+ toUpdateUserStatus.UserId = th.BasicUser2.Id
_, resp = Client.UpdateUserStatus(th.BasicUser2.Id, toUpdateUserStatus)
CheckForbiddenStatus(t, resp)
@@ -159,6 +160,9 @@ func TestUpdateUserStatus(t *testing.T) {
t.Fatal("Should return online status")
}
+ _, resp = Client.UpdateUserStatus(th.BasicUser.Id, toUpdateUserStatus)
+ CheckBadRequestStatus(t, resp)
+
Client.Logout()
_, resp = Client.UpdateUserStatus(th.BasicUser2.Id, toUpdateUserStatus)