Merge pull request #854 from justyns/gh842-invalid-join-url

Update the /join command to use the correct redirect URL
Этот коммит содержится в:
Christopher Speller
2015-09-29 14:06:59 -04:00
родитель 317dc0ea26 5064f9cba2
Коммит adfe129fcc
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@@ -195,7 +195,7 @@ func joinCommand(c *Context, command *model.Command) bool {
return false
}
command.GotoLocation = "/channels/" + v.Name
command.GotoLocation = c.GetTeamURL() + "/channels/" + v.Name
command.Response = model.RESP_EXECUTED
return true
}

Просмотреть файл

@@ -4,6 +4,7 @@
package api
import (
"strings"
"testing"
"github.com/mattermost/platform/model"
@@ -126,12 +127,12 @@ func TestJoinCommands(t *testing.T) {
}
rs5 := Client.Must(Client.Command("", "/join "+channel2.Name, false)).Data.(*model.Command)
if rs5.GotoLocation != "/channels/"+channel2.Name {
if !strings.HasSuffix(rs5.GotoLocation, "/"+team.Name+"/channels/"+channel2.Name) {
t.Fatal("failed to join channel")
}
rs6 := Client.Must(Client.Command("", "/join "+channel3.Name, false)).Data.(*model.Command)
if rs6.GotoLocation == "/channels/"+channel3.Name {
if strings.HasSuffix(rs6.GotoLocation, "/"+team.Name+"/channels/"+channel3.Name) {
t.Fatal("should not have joined direct message channel")
}