summaryrefslogtreecommitdiffstats
path: root/api/command_echo_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/command_echo_test.go')
-rw-r--r--api/command_echo_test.go19
1 files changed, 4 insertions, 15 deletions
diff --git a/api/command_echo_test.go b/api/command_echo_test.go
index 3bfaa0279..26fba007c 100644
--- a/api/command_echo_test.go
+++ b/api/command_echo_test.go
@@ -8,23 +8,12 @@ import (
"time"
"github.com/mattermost/platform/model"
- "github.com/mattermost/platform/store"
)
func TestEchoCommand(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)
+ th := Setup().InitBasic()
+ Client := th.BasicClient
+ channel1 := th.BasicChannel
echoTestString := "/echo test"
@@ -36,7 +25,7 @@ func TestEchoCommand(t *testing.T) {
time.Sleep(100 * time.Millisecond)
p1 := Client.Must(Client.GetPosts(channel1.Id, 0, 2, "")).Data.(*model.PostList)
- if len(p1.Order) != 1 {
+ if len(p1.Order) != 2 {
t.Fatal("Echo command failed to send")
}
}