github.com/gigforks/mattermost-server@v4.9.1-0.20180619094218-800d97fa55d0+incompatible/api/command_invite_people_test.go (about)

     1  // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
     2  // See License.txt for license information.
     3  
     4  package api
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/mattermost/mattermost-server/model"
    10  )
    11  
    12  func TestInvitePeopleCommand(t *testing.T) {
    13  	th := Setup().InitBasic()
    14  	defer th.TearDown()
    15  
    16  	Client := th.BasicClient
    17  	channel := th.BasicChannel
    18  
    19  	r1 := Client.Must(Client.Command(channel.Id, "/invite_people test@example.com")).Data.(*model.CommandResponse)
    20  	if r1 == nil {
    21  		t.Fatal("Command failed to execute")
    22  	}
    23  
    24  	r2 := Client.Must(Client.Command(channel.Id, "/invite_people test1@example.com test2@example.com")).Data.(*model.CommandResponse)
    25  	if r2 == nil {
    26  		t.Fatal("Command failed to execute")
    27  	}
    28  
    29  	r3 := Client.Must(Client.Command(channel.Id, "/invite_people")).Data.(*model.CommandResponse)
    30  	if r3 == nil {
    31  		t.Fatal("Command failed to execute")
    32  	}
    33  }