Fixing misspell errors (#8544)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
eb48292a3a
Коммит
014a3b6a60
@@ -573,7 +573,7 @@ func TestAdminResetPassword(t *testing.T) {
|
||||
Client.SetTeamId(team.Id)
|
||||
|
||||
if _, err := Client.AdminResetPassword(user.Id, "newpwd1"); err == nil {
|
||||
t.Fatal("Should have errored - not sytem admin")
|
||||
t.Fatal("Should have errored - not system admin")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ func TestLoadTestSetupCommands(t *testing.T) {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableTesting = true })
|
||||
|
||||
rs := Client.Must(Client.Command(channel.Id, "/test setup fuzz 1 1 1")).Data.(*model.CommandResponse)
|
||||
if rs.Text != "Created enviroment" {
|
||||
if rs.Text != "Created environment" {
|
||||
t.Fatal(rs.Text)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ func TestMeCommand(t *testing.T) {
|
||||
} else {
|
||||
if p1.Posts[p1.Order[0]].Message != `*hello*` {
|
||||
t.Log(p1.Posts[p1.Order[0]].Message)
|
||||
t.Fatal("invalid shrug reponse")
|
||||
t.Fatal("invalid shrug response")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ func TestShrugCommand(t *testing.T) {
|
||||
} else {
|
||||
if p1.Posts[p1.Order[0]].Message != `¯\\\_(ツ)\_/¯` {
|
||||
t.Log(p1.Posts[p1.Order[0]].Message)
|
||||
t.Fatal("invalid shrug reponse")
|
||||
t.Fatal("invalid shrug response")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func logClient(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
lvl := m["level"]
|
||||
msg := m["message"]
|
||||
|
||||
// filter out javascript errors from franz that are poluting the log files
|
||||
// filter out javascript errors from franz that are polluting the log files
|
||||
if strings.Contains(msg, "/franz") {
|
||||
forceToDebug = true
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ func TestOAuthRegenerateAppSecret(t *testing.T) {
|
||||
}
|
||||
|
||||
if app2.ClientSecret == oauthApp.ClientSecret {
|
||||
t.Fatal("Should have been diferent client Secrets")
|
||||
t.Fatal("Should have been different client Secrets")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -931,7 +931,7 @@ func TestUpdateTeamMemberRoles(t *testing.T) {
|
||||
t.Fatal("Should have worked, user is team admin and has the ability to manage permissions on this team.")
|
||||
// Note to anyone who thinks this test is wrong:
|
||||
// This operation will not effect the system admin's permissions because they have global access to all teams.
|
||||
// Their team level permissions are irrelavent. A team admin should be able to manage team level permissions.
|
||||
// Their team level permissions are irrelevant. A team admin should be able to manage team level permissions.
|
||||
}
|
||||
|
||||
// System admins should be able to manipulate permission no matter what their team level permissions are.
|
||||
|
||||
@@ -743,7 +743,7 @@ func viewChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
c.App.UpdateLastActivityAtIfNeeded(c.Session)
|
||||
|
||||
// Returning {"status": "OK", ...} for backwards compatability
|
||||
// Returning {"status": "OK", ...} for backwards compatibility
|
||||
resp := &model.ChannelViewResponse{
|
||||
Status: "OK",
|
||||
LastViewedAtTimes: times,
|
||||
|
||||
@@ -155,7 +155,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
h.handleFunc(c, w, r)
|
||||
}
|
||||
|
||||
// Handle errors that have occured
|
||||
// Handle errors that have occurred
|
||||
if c.Err != nil {
|
||||
c.Err.Translate(c.T)
|
||||
c.Err.RequestId = c.RequestId
|
||||
|
||||
@@ -129,7 +129,7 @@ func TestGetRolesByNames(t *testing.T) {
|
||||
assert.Contains(t, received, role2)
|
||||
assert.Contains(t, received, role3)
|
||||
|
||||
// Check a list of non-existant roles.
|
||||
// Check a list of non-existent roles.
|
||||
received, resp = th.Client.GetRolesByNames([]string{model.NewId(), model.NewId()})
|
||||
CheckNoError(t, resp)
|
||||
|
||||
|
||||
@@ -1676,7 +1676,7 @@ func TestUpdateTeamMemberRoles(t *testing.T) {
|
||||
// Note from API v3
|
||||
// Note to anyone who thinks this (above) test is wrong:
|
||||
// This operation will not affect the system admin's permissions because they have global access to all teams.
|
||||
// Their team level permissions are irrelavent. A team admin should be able to manage team level permissions.
|
||||
// Their team level permissions are irrelevant. A team admin should be able to manage team level permissions.
|
||||
|
||||
// System admins should be able to manipulate permission no matter what their team level permissions are.
|
||||
// system admin promotes user 2
|
||||
|
||||
@@ -19,7 +19,7 @@ func TestCheckIfRolesGrantPermission(t *testing.T) {
|
||||
shouldGrant bool
|
||||
}{
|
||||
{[]string{model.SYSTEM_ADMIN_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, true},
|
||||
{[]string{model.SYSTEM_ADMIN_ROLE_ID}, "non-existant-permission", false},
|
||||
{[]string{model.SYSTEM_ADMIN_ROLE_ID}, "non-existent-permission", false},
|
||||
{[]string{model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_READ_CHANNEL.Id, true},
|
||||
{[]string{model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, false},
|
||||
{[]string{model.SYSTEM_ADMIN_ROLE_ID, model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, true},
|
||||
|
||||
@@ -252,7 +252,7 @@ func (a *App) WaitForChannelMembership(channelId string, userId string) {
|
||||
return
|
||||
}
|
||||
|
||||
// If we recieved a error but it wasn't a missing channel member then return
|
||||
// If we received a error but it wasn't a missing channel member then return
|
||||
if result.Err.Id != store.MISSING_CHANNEL_MEMBER_ERROR {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ func (me *LoadTestProvider) SetupCommand(a *App, args *model.CommandArgs, messag
|
||||
doFuzz)
|
||||
}
|
||||
|
||||
return &model.CommandResponse{Text: "Created enviroment", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
|
||||
return &model.CommandResponse{Text: "Created environment", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
|
||||
}
|
||||
|
||||
func (me *LoadTestProvider) UsersCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
|
||||
@@ -79,7 +79,7 @@ func TestDiagnostics(t *testing.T) {
|
||||
t.Fail()
|
||||
}
|
||||
case <-time.After(time.Second * 1):
|
||||
t.Fatal("Did not recieve ID message")
|
||||
t.Fatal("Did not receive ID message")
|
||||
}
|
||||
|
||||
t.Run("Send", func(t *testing.T) {
|
||||
@@ -94,7 +94,7 @@ func TestDiagnostics(t *testing.T) {
|
||||
t.Fail()
|
||||
}
|
||||
case <-time.After(time.Second * 1):
|
||||
t.Fatal("Did not recieve diagnostic")
|
||||
t.Fatal("Did not receive diagnostic")
|
||||
}
|
||||
})
|
||||
|
||||
@@ -163,7 +163,7 @@ func TestDiagnostics(t *testing.T) {
|
||||
case <-data:
|
||||
t.Fatal("Should not send diagnostics when they are disabled")
|
||||
case <-time.After(time.Second * 1):
|
||||
// Did not recieve diagnostics
|
||||
// Did not receive diagnostics
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1338,11 +1338,11 @@ func TestImportImportChannel(t *testing.T) {
|
||||
t.Fatalf("Failed to get channel count.")
|
||||
}
|
||||
|
||||
// Do a valid channel in apply mode with a nonexistant team.
|
||||
// Do a valid channel in apply mode with a non-existent team.
|
||||
data.Name = ptrStr("channelname")
|
||||
data.Team = ptrStr(model.NewId())
|
||||
if err := th.App.ImportChannel(&data, false); err == nil {
|
||||
t.Fatalf("Expected error due to non-existant team (apply mode).")
|
||||
t.Fatalf("Expected error due to non-existent team (apply mode).")
|
||||
}
|
||||
|
||||
// Check that no more channels are in the DB.
|
||||
@@ -2501,7 +2501,7 @@ func TestImportImportDirectChannel(t *testing.T) {
|
||||
model.NewId(),
|
||||
}
|
||||
if err := th.App.ImportDirectChannel(&data, true); err != nil {
|
||||
t.Fatalf("Expected success as cannot validate existance of channel members in dry run mode.")
|
||||
t.Fatalf("Expected success as cannot validate existence of channel members in dry run mode.")
|
||||
}
|
||||
|
||||
// Check that no more channels are in the DB.
|
||||
@@ -2515,7 +2515,7 @@ func TestImportImportDirectChannel(t *testing.T) {
|
||||
model.NewId(),
|
||||
}
|
||||
if err := th.App.ImportDirectChannel(&data, true); err != nil {
|
||||
t.Fatalf("Expected success as cannot validate existance of channel members in dry run mode.")
|
||||
t.Fatalf("Expected success as cannot validate existence of channel members in dry run mode.")
|
||||
}
|
||||
|
||||
// Check that no more channels are in the DB.
|
||||
|
||||
@@ -47,7 +47,7 @@ func resetCmdF(command *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
a.Srv.Store.DropAllTables()
|
||||
cmd.CommandPrettyPrintln("Database sucessfully reset")
|
||||
cmd.CommandPrettyPrintln("Database successfully reset")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ func migrateAuthToLdapCmdF(command *cobra.Command, args []string) error {
|
||||
return errors.New("Error while migrating users: " + err.Error())
|
||||
}
|
||||
|
||||
cmd.CommandPrettyPrintln("Sucessfully migrated accounts.")
|
||||
cmd.CommandPrettyPrintln("Successfully migrated accounts.")
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -631,7 +631,7 @@ func migrateAuthToSamlCmdF(command *cobra.Command, args []string) error {
|
||||
return errors.New("Error while migrating users: " + err.Error())
|
||||
}
|
||||
l4g.Close()
|
||||
cmd.CommandPrettyPrintln("Sucessfully migrated accounts.")
|
||||
cmd.CommandPrettyPrintln("Successfully migrated accounts.")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -66,7 +66,7 @@ func (watcher *Watcher) Stop() {
|
||||
|
||||
func (watcher *Watcher) PollAndNotify() {
|
||||
if result := <-watcher.srv.Store.Job().GetAllByStatus(model.JOB_STATUS_PENDING); result.Err != nil {
|
||||
l4g.Error("Error occured getting all pending statuses: %v", result.Err.Error())
|
||||
l4g.Error("Error occurred getting all pending statuses: %v", result.Err.Error())
|
||||
} else {
|
||||
jobs := result.Data.([]*model.Job)
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ func manualTest(c *api.Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// Respond with an auth token this can be overriden by a specific test as required
|
||||
// Respond with an auth token this can be overridden by a specific test as required
|
||||
sessionCookie := &http.Cookie{
|
||||
Name: model.SESSION_COOKIE_TOKEN,
|
||||
Value: client.AuthToken,
|
||||
|
||||
@@ -72,7 +72,7 @@ type Client struct {
|
||||
ServerVersion string
|
||||
}
|
||||
|
||||
// NewClient constructs a new client with convienence methods for talking to
|
||||
// NewClient constructs a new client with convenience methods for talking to
|
||||
// the server.
|
||||
func NewClient(url string) *Client {
|
||||
return &Client{url, url + API_URL_SUFFIX_V3, &http.Client{}, "", "", "", "", "", ""}
|
||||
@@ -257,7 +257,7 @@ func (c *Client) clearExtraProperties() {
|
||||
// General Routes Section
|
||||
|
||||
// GetClientProperties returns properties needed by the client to show/hide
|
||||
// certian features. It returns a map of strings.
|
||||
// certain features. It returns a map of strings.
|
||||
func (c *Client) GetClientProperties() (map[string]string, *AppError) {
|
||||
c.clearExtraProperties()
|
||||
if r, err := c.DoApiGet(c.GetGeneralRoute()+"/client_props", "", ""); err != nil {
|
||||
@@ -2231,7 +2231,7 @@ func (c *Client) GetCustomEmojiImageUrl(id string) string {
|
||||
|
||||
// Uploads a x509 base64 Certificate or Private Key file to be used with SAML.
|
||||
// data byte array is required and needs to be a Multi-Part with 'certificate' as the field name
|
||||
// contentType is also required. Returns nil if succesful, otherwise returns an AppError
|
||||
// contentType is also required. Returns nil if successful, otherwise returns an AppError
|
||||
func (c *Client) UploadCertificateFile(data []byte, contentType string) *AppError {
|
||||
url := c.ApiUrl + "/admin/add_certificate"
|
||||
rq, _ := http.NewRequest("POST", url, bytes.NewReader(data))
|
||||
|
||||
@@ -1128,7 +1128,7 @@ type LdapSettings struct {
|
||||
IdAttribute *string
|
||||
PositionAttribute *string
|
||||
|
||||
// Syncronization
|
||||
// Synchronization
|
||||
SyncIntervalMinutes *int
|
||||
|
||||
// Advanced
|
||||
|
||||
@@ -26,7 +26,7 @@ type WebSocketClient struct {
|
||||
ListenError *AppError
|
||||
}
|
||||
|
||||
// NewWebSocketClient constructs a new WebSocket client with convienence
|
||||
// NewWebSocketClient constructs a new WebSocket client with convenience
|
||||
// methods for talking to the server.
|
||||
func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError) {
|
||||
conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX_V3+"/users/websocket", nil)
|
||||
@@ -51,7 +51,7 @@ func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError) {
|
||||
return client, nil
|
||||
}
|
||||
|
||||
// NewWebSocketClient4 constructs a new WebSocket client with convienence
|
||||
// NewWebSocketClient4 constructs a new WebSocket client with convenience
|
||||
// methods for talking to the server. Uses the v4 endpoint.
|
||||
func NewWebSocketClient4(url, authToken string) (*WebSocketClient, *AppError) {
|
||||
conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX+"/websocket", nil)
|
||||
|
||||
@@ -750,7 +750,7 @@ func (s SqlChannelStore) SaveMember(member *model.ChannelMember) store.StoreChan
|
||||
if err := transaction.Commit(); err != nil {
|
||||
result.Err = model.NewAppError("SqlChannelStore.SaveMember", "store.sql_channel.save_member.commit_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
// If sucessfull record members have changed in channel
|
||||
// If successfull record members have changed in channel
|
||||
if mu := <-s.extraUpdated(channel); mu.Err != nil {
|
||||
result.Err = mu.Err
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ func (s SqlChannelStore) RemoveMember(channelId string, userId string) store.Sto
|
||||
if err != nil {
|
||||
result.Err = model.NewAppError("SqlChannelStore.RemoveMember", "store.sql_channel.remove_member.app_error", nil, "channel_id="+channelId+", user_id="+userId+", "+err.Error(), http.StatusInternalServerError)
|
||||
} else {
|
||||
// If sucessfull record members have changed in channel
|
||||
// If successfull record members have changed in channel
|
||||
if mu := <-s.extraUpdated(channel); mu.Err != nil {
|
||||
result.Err = mu.Err
|
||||
}
|
||||
|
||||
@@ -1463,11 +1463,11 @@ func testGetMember(t *testing.T, ss store.Store) {
|
||||
store.Must(ss.Channel().SaveMember(m2))
|
||||
|
||||
if result := <-ss.Channel().GetMember(model.NewId(), userId); result.Err == nil {
|
||||
t.Fatal("should've failed to get member for non-existant channel")
|
||||
t.Fatal("should've failed to get member for non-existent channel")
|
||||
}
|
||||
|
||||
if result := <-ss.Channel().GetMember(c1.Id, model.NewId()); result.Err == nil {
|
||||
t.Fatal("should've failed to get member for non-existant user")
|
||||
t.Fatal("should've failed to get member for non-existent user")
|
||||
}
|
||||
|
||||
if result := <-ss.Channel().GetMember(c1.Id, userId); result.Err != nil {
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestFindConfigFile(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestConfigFromEnviroVars(t *testing.T) {
|
||||
os.Setenv("MM_TEAMSETTINGS_SITENAME", "From Enviroment")
|
||||
os.Setenv("MM_TEAMSETTINGS_SITENAME", "From Environment")
|
||||
os.Setenv("MM_TEAMSETTINGS_CUSTOMBRANDTEXT", "Custom Brand")
|
||||
os.Setenv("MM_SERVICESETTINGS_ENABLECOMMANDS", "false")
|
||||
os.Setenv("MM_SERVICESETTINGS_READTIMEOUT", "400")
|
||||
@@ -59,20 +59,20 @@ func TestConfigFromEnviroVars(t *testing.T) {
|
||||
cfg, cfgPath, err := LoadConfig("config.json")
|
||||
require.Nil(t, err)
|
||||
|
||||
if cfg.TeamSettings.SiteName != "From Enviroment" {
|
||||
t.Fatal("Couldn't read config from enviroment var")
|
||||
if cfg.TeamSettings.SiteName != "From Environment" {
|
||||
t.Fatal("Couldn't read config from environment var")
|
||||
}
|
||||
|
||||
if *cfg.TeamSettings.CustomBrandText != "Custom Brand" {
|
||||
t.Fatal("Couldn't read config from enviroment var")
|
||||
t.Fatal("Couldn't read config from environment var")
|
||||
}
|
||||
|
||||
if *cfg.ServiceSettings.EnableCommands {
|
||||
t.Fatal("Couldn't read config from enviroment var")
|
||||
t.Fatal("Couldn't read config from environment var")
|
||||
}
|
||||
|
||||
if *cfg.ServiceSettings.ReadTimeout != 400 {
|
||||
t.Fatal("Couldn't read config from enviroment var")
|
||||
t.Fatal("Couldn't read config from environment var")
|
||||
}
|
||||
|
||||
os.Unsetenv("MM_TEAMSETTINGS_SITENAME")
|
||||
|
||||
@@ -96,7 +96,7 @@ func GetUserTranslations(locale string) i18n.TranslateFunc {
|
||||
func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) {
|
||||
// This is for checking against locales like pt_BR or zn_CN
|
||||
headerLocaleFull := strings.Split(r.Header.Get("Accept-Language"), ",")[0]
|
||||
// This is for checking agains locales like en, es
|
||||
// This is for checking against locales like en, es
|
||||
headerLocale := strings.Split(strings.Split(r.Header.Get("Accept-Language"), ",")[0], "-")[0]
|
||||
defaultLocale := *settings.DefaultClientLocale
|
||||
if locales[headerLocaleFull] != "" {
|
||||
|
||||
@@ -82,7 +82,7 @@ func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) {
|
||||
case "Password:":
|
||||
return []byte(a.password), nil
|
||||
default:
|
||||
return nil, errors.New("Unkown fromServer")
|
||||
return nil, errors.New("Unknown fromServer")
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
|
||||
Ссылка в новой задаче
Block a user