summaryrefslogtreecommitdiffstats
path: root/app/channel_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/channel_test.go')
-rw-r--r--app/channel_test.go22
1 files changed, 20 insertions, 2 deletions
diff --git a/app/channel_test.go b/app/channel_test.go
index a4e0806a6..336d9b25b 100644
--- a/app/channel_test.go
+++ b/app/channel_test.go
@@ -120,7 +120,7 @@ func TestJoinDefaultChannelsCreatesChannelMemberHistoryRecordTownSquare(t *testi
// create a new user that joins the default channels
user := th.CreateUser()
- th.App.JoinDefaultChannels(th.BasicTeam.Id, user, model.CHANNEL_USER_ROLE_ID, "")
+ th.App.JoinDefaultChannels(th.BasicTeam.Id, user, false, "")
// there should be a ChannelMemberHistory record for the user
histories := store.Must(th.App.Srv.Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, townSquareChannelId)).([]*model.ChannelMemberHistoryResult)
@@ -146,7 +146,7 @@ func TestJoinDefaultChannelsCreatesChannelMemberHistoryRecordOffTopic(t *testing
// create a new user that joins the default channels
user := th.CreateUser()
- th.App.JoinDefaultChannels(th.BasicTeam.Id, user, model.CHANNEL_USER_ROLE_ID, "")
+ th.App.JoinDefaultChannels(th.BasicTeam.Id, user, false, "")
// there should be a ChannelMemberHistory record for the user
histories := store.Must(th.App.Srv.Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, offTopicChannelId)).([]*model.ChannelMemberHistoryResult)
@@ -381,3 +381,21 @@ func TestAddChannelMemberNoUserRequestor(t *testing.T) {
assert.Equal(t, user.Username, post.Props["username"])
}
}
+
+func TestAppUpdateChannelScheme(t *testing.T) {
+ th := Setup().InitBasic()
+ defer th.TearDown()
+
+ channel := th.BasicChannel
+ mockID := model.NewString("x")
+ channel.SchemeId = mockID
+
+ updatedChannel, err := th.App.UpdateChannelScheme(channel)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if updatedChannel.SchemeId != mockID {
+ t.Fatal("Wrong Channel SchemeId")
+ }
+}