diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-08-17 09:28:20 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-08-17 09:28:20 -0400 |
commit | b068cc1058a2909e7fc9d9622e806d52127bfa52 (patch) | |
tree | 0670b4f8fc4c7afd97c785728a79736138a40445 /api/user_test.go | |
parent | e5a38174884310a07e62bed99e10b655c5c6749f (diff) | |
download | chat-b068cc1058a2909e7fc9d9622e806d52127bfa52.tar.gz chat-b068cc1058a2909e7fc9d9622e806d52127bfa52.tar.bz2 chat-b068cc1058a2909e7fc9d9622e806d52127bfa52.zip |
when user roles are updated, the relevant session roles are updated as well
Diffstat (limited to 'api/user_test.go')
-rw-r--r-- | api/user_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/api/user_test.go b/api/user_test.go index 8b95bdf55..776b17b3c 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -651,6 +651,12 @@ func TestUserUpdateRoles(t *testing.T) { t.Fatal("Should have errored, not admin") } + name := make(map[string]string) + name["new_name"] = "NewName" + if _, err := Client.UpdateTeamDisplayName(name); err == nil { + t.Fatal("should have errored - user not admin yet") + } + team2 := &model.Team{DisplayName: "Name", Name: "z-z-" + model.NewId() + "a", Email: "test@nowhere.com", Type: model.TEAM_OPEN} team2 = Client.Must(Client.CreateTeam(team2)).Data.(*model.Team) @@ -690,6 +696,12 @@ func TestUserUpdateRoles(t *testing.T) { t.Fatal("Roles did not update properly") } } + + Client.LoginByEmail(team.Name, user2.Email, "pwd") + + if _, err := Client.UpdateTeamDisplayName(name); err != nil { + t.Fatal(err) + } } func TestUserUpdateActive(t *testing.T) { |