From 97558f6a6ec4c53fa69035fb430ead209d9c222d Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 13 Jan 2017 13:53:37 -0500 Subject: PLT-4938 Add app package and move logic over from api package (#4931) * Add app package and move logic over from api package * Change app package functions to return errors * Move non-api tests into app package * Fix merge --- api/channel_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'api/channel_test.go') diff --git a/api/channel_test.go b/api/channel_test.go index 8bfa0e896..1bce8b9fd 100644 --- a/api/channel_test.go +++ b/api/channel_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + "github.com/mattermost/platform/app" "github.com/mattermost/platform/model" "github.com/mattermost/platform/store" "github.com/mattermost/platform/utils" @@ -1067,7 +1068,7 @@ func TestJoinChannelByNameDisabledUser(t *testing.T) { Client.Must(th.BasicClient.RemoveUserFromTeam(th.BasicTeam.Id, th.BasicUser.Id)) - if _, err := AddUserToChannel(th.BasicUser, channel1); err == nil { + if _, err := app.AddUserToChannel(th.BasicUser, channel1); err == nil { t.Fatal("shoudn't be able to join channel") } else { if err.Id != "api.channel.add_user.to.channel.failed.deleted.app_error" { @@ -1832,7 +1833,7 @@ func TestGetChannelByName(t *testing.T) { user2 := &model.User{Email: "success+" + model.NewId() + "@simulator.amazonses.com", Nickname: "Jabba the Hutt", Password: "passwd1"} user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User) - store.Must(Srv.Store.User().VerifyEmail(user2.Id)) + store.Must(app.Srv.Store.User().VerifyEmail(user2.Id)) Client.SetTeamId(th.BasicTeam.Id) @@ -1887,7 +1888,7 @@ func TestViewChannel(t *testing.T) { func TestGetChannelMembersByIds(t *testing.T) { th := Setup().InitBasic() - if _, err := AddUserToChannel(th.BasicUser2, th.BasicChannel); err != nil { + if _, err := app.AddUserToChannel(th.BasicUser2, th.BasicChannel); err != nil { t.Fatal("Could not add second user to channel") } -- cgit v1.2.3-1-g7c22