Merge pull request #1720 from rgarmsen2295/plt-860

PLT 860 & 1116 - Changes test emails to include a '+' and fixes email verification issue with emails that included a '+'
Этот коммит содержится в:
Harrison Healey
2015-12-14 09:54:11 -05:00
родитель b9a4966e7d 7fb1551254
Коммит aec25ceb4b
16 изменённых файлов: 130 добавлений и 130 удалений

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

@@ -230,7 +230,7 @@ func (c *Client) CreateUser(user *User, hash string) (*Result, *AppError) {
}
func (c *Client) CreateUserFromSignup(user *User, data string, hash string) (*Result, *AppError) {
if r, err := c.DoApiPost("/users/create?d="+data+"&h="+hash, user.ToJson()); err != nil {
if r, err := c.DoApiPost("/users/create?d="+url.QueryEscape(data)+"&h="+hash, user.ToJson()); err != nil {
return nil, err
} else {
return &Result{r.Header.Get(HEADER_REQUEST_ID),

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

@@ -45,7 +45,7 @@ func TestTeamIsValid(t *testing.T) {
t.Fatal("should be invalid")
}
o.Email = "corey@hulen.com"
o.Email = "corey+test@hulen.com"
o.DisplayName = strings.Repeat("01234567890", 20)
if err := o.IsValid(true); err == nil {
t.Fatal("should be invalid")

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

@@ -56,21 +56,21 @@ func TestMapJson(t *testing.T) {
}
func TestValidEmail(t *testing.T) {
if !IsValidEmail("corey@hulen.com") {
if !IsValidEmail("corey+test@hulen.com") {
t.Error("email should be valid")
}
if IsValidEmail("@corey@hulen.com") {
if IsValidEmail("@corey+test@hulen.com") {
t.Error("should be invalid")
}
}
func TestValidLower(t *testing.T) {
if !IsLower("corey@hulen.com") {
if !IsLower("corey+test@hulen.com") {
t.Error("should be valid")
}
if IsLower("Corey@hulen.com") {
if IsLower("Corey+test@hulen.com") {
t.Error("should be invalid")
}
}