Skip to content

Commit

Permalink
Fix delete channel test (#5863)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilander authored and coreyhulen committed Mar 23, 2017
1 parent 37c41a2 commit 42c3ea6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api4/channel_test.go
Expand Up @@ -583,6 +583,9 @@ func TestDeleteChannel(t *testing.T) {
// successful delete by team admin
UpdateUserToTeamAdmin(user, team)
app.InvalidateAllCaches()
utils.IsLicensed = true
utils.License = &model.License{Features: &model.Features{}}
utils.License.Features.SetDefaults()

_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckNoError(t, resp)
Expand All @@ -595,6 +598,9 @@ func TestDeleteChannel(t *testing.T) {
utils.SetDefaultRolesBasedOnConfig()
UpdateUserToNonTeamAdmin(user, team)
app.InvalidateAllCaches()
utils.IsLicensed = true
utils.License = &model.License{Features: &model.Features{}}
utils.License.Features.SetDefaults()

// channels created by SystemAdmin
publicChannel6 = th.CreateChannelWithClient(th.SystemAdminClient, model.CHANNEL_OPEN)
Expand Down Expand Up @@ -623,6 +629,9 @@ func TestDeleteChannel(t *testing.T) {
// successful delete by team admin
UpdateUserToTeamAdmin(th.BasicUser, team)
app.InvalidateAllCaches()
utils.IsLicensed = true
utils.License = &model.License{Features: &model.Features{}}
utils.License.Features.SetDefaults()

_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckNoError(t, resp)
Expand Down Expand Up @@ -661,6 +670,9 @@ func TestDeleteChannel(t *testing.T) {
// cannot delete by team admin
UpdateUserToTeamAdmin(th.BasicUser, team)
app.InvalidateAllCaches()
utils.IsLicensed = true
utils.License = &model.License{Features: &model.Features{}}
utils.License.Features.SetDefaults()

_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckForbiddenStatus(t, resp)
Expand Down

0 comments on commit 42c3ea6

Please sign in to comment.