коммит произвёл
GitHub
родитель
8ef7f78d8d
Коммит
532f2882d1
@@ -64,6 +64,21 @@ func TestMoveCommand(t *testing.T) {
|
||||
retrievedCommand, err = th.App.GetCommand(command.Id)
|
||||
assert.Nil(t, err)
|
||||
assert.EqualValues(t, targetTeam.Id, retrievedCommand.TeamId)
|
||||
|
||||
// Move a command to a team where the trigger already exists should fail.
|
||||
command2 := &model.Command{}
|
||||
command2.CreatorId = model.NewId()
|
||||
command2.Method = model.CommandMethodPost
|
||||
command2.TeamId = sourceTeam.Id
|
||||
command2.URL = "http://nowhere.com/"
|
||||
command2.Trigger = "trigger1"
|
||||
|
||||
command2, err = th.App.CreateCommand(command2)
|
||||
assert.Nil(t, err)
|
||||
|
||||
moveErr := th.App.MoveCommand(targetTeam, command2)
|
||||
assert.NotNil(t, moveErr)
|
||||
assert.Equal(t, "api.command.duplicate_trigger.app_error", moveErr.Id)
|
||||
}
|
||||
|
||||
func TestCreateCommandPost(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user