summaryrefslogtreecommitdiffstats
path: root/api/team_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-11-18 12:48:45 -0500
committerJoram Wilander <jwawilander@gmail.com>2015-11-18 12:48:45 -0500
commite408d615c02ae3c863df3c7dc13d1b813c22fd28 (patch)
treea1c607b7721831c71aadbf89f018ed7b11a0e426 /api/team_test.go
parent9660adb00775aba822d2d684d215c55679a456c6 (diff)
parentc115191d6b5abdefda856c063e3f9048dc82f830 (diff)
downloadchat-e408d615c02ae3c863df3c7dc13d1b813c22fd28.tar.gz
chat-e408d615c02ae3c863df3c7dc13d1b813c22fd28.tar.bz2
chat-e408d615c02ae3c863df3c7dc13d1b813c22fd28.zip
Merge pull request #1448 from mattermost/PLT-975
PLT-975 adding delete to command line tool
Diffstat (limited to 'api/team_test.go')
-rw-r--r--api/team_test.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/api/team_test.go b/api/team_test.go
index 7a3b092ce..0b7d2ed9c 100644
--- a/api/team_test.go
+++ b/api/team_test.go
@@ -168,6 +168,45 @@ func TestGetAllTeams(t *testing.T) {
}
}
+func TestTeamPermDelete(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.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: "TestGetPosts", Name: "a" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: team.Id}
+ channel1 = Client.Must(Client.CreateChannel(channel1)).Data.(*model.Channel)
+
+ post1 := &model.Post{ChannelId: channel1.Id, Message: "search for post1"}
+ post1 = Client.Must(Client.CreatePost(post1)).Data.(*model.Post)
+
+ post2 := &model.Post{ChannelId: channel1.Id, Message: "search for post2"}
+ post2 = Client.Must(Client.CreatePost(post2)).Data.(*model.Post)
+
+ post3 := &model.Post{ChannelId: channel1.Id, Message: "#hashtag search for post3"}
+ post3 = Client.Must(Client.CreatePost(post3)).Data.(*model.Post)
+
+ post4 := &model.Post{ChannelId: channel1.Id, Message: "hashtag for post4"}
+ post4 = Client.Must(Client.CreatePost(post4)).Data.(*model.Post)
+
+ c := &Context{}
+ c.RequestId = model.NewId()
+ c.IpAddress = "test"
+
+ err := PermanentDeleteTeam(c, team)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ Client.ClearOAuthToken()
+}
+
/*
XXXXXX investigate and fix failing test
@@ -221,6 +260,7 @@ func TestFindTeamByEmailSend(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ Client.LoginByEmail(team.Name, user.Email, "pwd")
if _, err := Client.FindTeamsSendEmail(user.Email); err != nil {
t.Fatal(err)