From b1a7c1acf139efbb5312b4aa939bd94155e6a9e6 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sat, 9 Jan 2016 08:54:07 -0600 Subject: adding different commands --- api/command_logout_test.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 api/command_logout_test.go (limited to 'api/command_logout_test.go') diff --git a/api/command_logout_test.go b/api/command_logout_test.go new file mode 100644 index 000000000..4c8f3e017 --- /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 TestLogoutCommand(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") + } +} -- cgit v1.2.3-1-g7c22 From a70d5504091b93773e3cc0290be32ae51660bf30 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sun, 10 Jan 2016 01:13:51 -0600 Subject: Adding loading testing commands --- api/command_logout_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/command_logout_test.go') diff --git a/api/command_logout_test.go b/api/command_logout_test.go index 4c8f3e017..86979316b 100644 --- a/api/command_logout_test.go +++ b/api/command_logout_test.go @@ -10,7 +10,7 @@ import ( "github.com/mattermost/platform/store" ) -func TestLogoutCommand(t *testing.T) { +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} -- cgit v1.2.3-1-g7c22