summaryrefslogtreecommitdiffstats
path: root/api/channel_test.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-01-20 13:12:19 -0600
committerCorey Hulen <corey@hulen.com>2016-01-20 13:12:19 -0600
commit0b1aff3b24b4ac2df8e963c83d6e52b127c603f9 (patch)
tree47735a3dd609e025837df4460b0d030454358cf1 /api/channel_test.go
parent1acd38b7b19521d06d274c42c00ce7072cd92196 (diff)
parent75f8729e2d25467500778e633c45c97e78a8f7a0 (diff)
downloadchat-0b1aff3b24b4ac2df8e963c83d6e52b127c603f9.tar.gz
chat-0b1aff3b24b4ac2df8e963c83d6e52b127c603f9.tar.bz2
chat-0b1aff3b24b4ac2df8e963c83d6e52b127c603f9.zip
Merge pull request #1930 from mattermost/PLT-7-server-db
PLT-7 adding loc for db calls
Diffstat (limited to 'api/channel_test.go')
-rw-r--r--api/channel_test.go60
1 files changed, 30 insertions, 30 deletions
diff --git a/api/channel_test.go b/api/channel_test.go
index 117278378..27034aadd 100644
--- a/api/channel_test.go
+++ b/api/channel_test.go
@@ -24,7 +24,7 @@ func TestCreateChannel(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")
@@ -101,11 +101,11 @@ func TestCreateDirectChannel(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user2.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")
@@ -156,15 +156,15 @@ func TestUpdateChannel(t *testing.T) {
userTeamAdmin := &model.User{TeamId: team.Id, Email: team.Email, Nickname: "Corey Hulen", Password: "pwd"}
userTeamAdmin = Client.Must(Client.CreateUser(userTeamAdmin, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userTeamAdmin.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userTeamAdmin.Id))
userChannelAdmin := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userChannelAdmin = Client.Must(Client.CreateUser(userChannelAdmin, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userChannelAdmin.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userChannelAdmin.Id))
userStd := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userStd = Client.Must(Client.CreateUser(userStd, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userStd.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userStd.Id))
userStd.Roles = ""
Client.LoginByEmail(team.Name, userChannelAdmin.Email, "pwd")
@@ -238,7 +238,7 @@ func TestUpdateChannelHeader(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")
@@ -278,7 +278,7 @@ func TestUpdateChannelHeader(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user2.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd")
@@ -297,7 +297,7 @@ func TestUpdateChannelPurpose(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")
@@ -337,7 +337,7 @@ func TestUpdateChannelPurpose(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user2.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd")
@@ -356,7 +356,7 @@ func TestGetChannel(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")
@@ -419,7 +419,7 @@ func TestGetMoreChannel(t *testing.T) {
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))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user1.Id))
Client.LoginByEmail(team.Name, user1.Email, "pwd")
@@ -431,7 +431,7 @@ func TestGetMoreChannel(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user2.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd")
@@ -463,7 +463,7 @@ func TestGetChannelCounts(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")
@@ -504,7 +504,7 @@ func TestJoinChannel(t *testing.T) {
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))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user1.Id))
Client.LoginByEmail(team.Name, user1.Email, "pwd")
@@ -516,7 +516,7 @@ func TestJoinChannel(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user2.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd")
@@ -548,7 +548,7 @@ func TestLeaveChannel(t *testing.T) {
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))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user1.Id))
Client.LoginByEmail(team.Name, user1.Email, "pwd")
@@ -560,7 +560,7 @@ func TestLeaveChannel(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user2.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd")
@@ -597,11 +597,11 @@ func TestDeleteChannel(t *testing.T) {
userTeamAdmin := &model.User{TeamId: team.Id, Email: team.Email, Nickname: "Corey Hulen", Password: "pwd"}
userTeamAdmin = Client.Must(Client.CreateUser(userTeamAdmin, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userTeamAdmin.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userTeamAdmin.Id))
userChannelAdmin := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userChannelAdmin = Client.Must(Client.CreateUser(userChannelAdmin, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userChannelAdmin.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userChannelAdmin.Id))
Client.LoginByEmail(team.Name, userChannelAdmin.Email, "pwd")
@@ -633,7 +633,7 @@ func TestDeleteChannel(t *testing.T) {
userStd := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userStd = Client.Must(Client.CreateUser(userStd, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userStd.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userStd.Id))
Client.LoginByEmail(team.Name, userStd.Email, "pwd")
@@ -667,7 +667,7 @@ func TestGetChannelExtraInfo(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")
@@ -703,7 +703,7 @@ func TestGetChannelExtraInfo(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "tester2@test.com", Nickname: "Tester 2", Password: "pwd"}
user2 = Client2.Must(Client2.CreateUser(user2, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user2.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client2.LoginByEmail(team.Name, user2.Email, "pwd")
Client2.Must(Client2.JoinChannel(channel1.Id))
@@ -791,7 +791,7 @@ func TestAddChannelMember(t *testing.T) {
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))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user1.Id))
Client.LoginByEmail(team.Name, user1.Email, "pwd")
@@ -800,7 +800,7 @@ func TestAddChannelMember(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user2.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
if _, err := Client.AddChannelMember(channel1.Id, user2.Id); err != nil {
t.Fatal(err)
@@ -849,11 +849,11 @@ func TestRemoveChannelMember(t *testing.T) {
userTeamAdmin := &model.User{TeamId: team.Id, Email: team.Email, Nickname: "Corey Hulen", Password: "pwd"}
userTeamAdmin = Client.Must(Client.CreateUser(userTeamAdmin, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userTeamAdmin.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userTeamAdmin.Id))
userChannelAdmin := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userChannelAdmin = Client.Must(Client.CreateUser(userChannelAdmin, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userChannelAdmin.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userChannelAdmin.Id))
Client.LoginByEmail(team.Name, userChannelAdmin.Email, "pwd")
@@ -869,7 +869,7 @@ func TestRemoveChannelMember(t *testing.T) {
userStd := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userStd = Client.Must(Client.CreateUser(userStd, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(userStd.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, userStd.Id))
Client.Must(Client.AddChannelMember(channel1.Id, userStd.Id))
@@ -919,7 +919,7 @@ func TestUpdateNotifyProps(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")
@@ -1041,7 +1041,7 @@ func TestFuzzyChannel(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
+ store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd")