diff options
Diffstat (limited to 'api/command_logout_test.go')
-rw-r--r-- | api/command_logout_test.go | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/api/command_logout_test.go b/api/command_logout_test.go index eee7520a8..eec959115 100644 --- a/api/command_logout_test.go +++ b/api/command_logout_test.go @@ -8,25 +8,12 @@ import ( "testing" "github.com/mattermost/platform/model" - "github.com/mattermost/platform/store" ) func TestLogoutTestCommand(t *testing.T) { - Setup() + th := Setup().InitBasic() - 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) + rs1 := th.BasicClient.Must(th.BasicClient.Command(th.BasicChannel.Id, "/logout", false)).Data.(*model.CommandResponse) if !strings.HasSuffix(rs1.GotoLocation, "logout") { t.Fatal("failed to logout") } |