Merge pull request #2373 from mattermost/PLT-1988

PLT-1988 fixing slash logout
Этот коммит содержится в:
Harrison Healey
2016-03-08 10:05:12 -05:00
родитель c18cac1f71 e7ece19957
Коммит 8fc42cbeb6
2 изменённых файлов: 4 добавлений и 2 удалений

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

@@ -33,5 +33,6 @@ func (me *LogoutProvider) GetCommand(c *Context) *model.Command {
}
func (me *LogoutProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse {
return &model.CommandResponse{GotoLocation: "/logout", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: c.T("api.command_logout.success_message")}
return &model.CommandResponse{GotoLocation: c.GetTeamURL() + "/logout", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: c.T("api.command_logout.success_message")}
}

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

@@ -4,6 +4,7 @@
package api
import (
"strings"
"testing"
"github.com/mattermost/platform/model"
@@ -26,7 +27,7 @@ func TestLogoutTestCommand(t *testing.T) {
channel1 = Client.Must(Client.CreateChannel(channel1)).Data.(*model.Channel)
rs1 := Client.Must(Client.Command(channel1.Id, "/logout", false)).Data.(*model.CommandResponse)
if rs1.GotoLocation != "/logout" {
if !strings.HasSuffix(rs1.GotoLocation, "logout") {
t.Fatal("failed to logout")
}
}