diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-02-04 11:38:27 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-02-04 11:38:27 -0500 |
commit | 4f1dbb8ca9a6cce09c9a20e91e074feaadd755a8 (patch) | |
tree | d5811b516ef8b826e6ccd80efdf72c6fe52157a2 /api/command_logout_test.go | |
parent | 852acf1bb2818316e40012a385a5e8bec287eb05 (diff) | |
parent | dffc5323ecd9c7bc1af0ea06ef4827078f9bcd52 (diff) | |
download | chat-4f1dbb8ca9a6cce09c9a20e91e074feaadd755a8.tar.gz chat-4f1dbb8ca9a6cce09c9a20e91e074feaadd755a8.tar.bz2 chat-4f1dbb8ca9a6cce09c9a20e91e074feaadd755a8.zip |
Merge pull request #2052 from mattermost/PLT-1429
PLT-1429 adding user created slash commands
Diffstat (limited to 'api/command_logout_test.go')
-rw-r--r-- | api/command_logout_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/api/command_logout_test.go b/api/command_logout_test.go new file mode 100644 index 000000000..86979316b --- /dev/null +++ b/api/command_logout_test.go @@ -0,0 +1,32 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package api + +import ( + "testing" + + "github.com/mattermost/platform/model" + "github.com/mattermost/platform/store" +) + +func TestLogoutTestCommand(t *testing.T) { + Setup() + + team := &model.Team{DisplayName: "Name", Name: "z-z-" + model.NewId() + "a", Email: "test@nowhere.com", Type: model.TEAM_OPEN} + team = Client.Must(Client.CreateTeam(team)).Data.(*model.Team) + + user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} + user1 = Client.Must(Client.CreateUser(user1, "")).Data.(*model.User) + store.Must(Srv.Store.User().VerifyEmail(user1.Id)) + + Client.LoginByEmail(team.Name, user1.Email, "pwd") + + channel1 := &model.Channel{DisplayName: "AA", Name: "aa" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: team.Id} + channel1 = Client.Must(Client.CreateChannel(channel1)).Data.(*model.Channel) + + rs1 := Client.Must(Client.Command(channel1.Id, "/logout", false)).Data.(*model.CommandResponse) + if rs1.GotoLocation != "/logout" { + t.Fatal("failed to logout") + } +} |