From e7eb86c8c31e7d0cfd7f18efdefc4ac50171e8a0 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Sun, 13 Dec 2015 14:21:23 -0800 Subject: Updated emails in unit tests to include '+' --- model/team_test.go | 2 +- model/utils_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'model') diff --git a/model/team_test.go b/model/team_test.go index 112d48a9d..4b691e76a 100644 --- a/model/team_test.go +++ b/model/team_test.go @@ -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") diff --git a/model/utils_test.go b/model/utils_test.go index 1f1e5f023..6d6f9e653 100644 --- a/model/utils_test.go +++ b/model/utils_test.go @@ -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") } } -- cgit v1.2.3-1-g7c22 From b9d93b104c3b928eebeb75df9a40cff0fd5abe15 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Sun, 13 Dec 2015 14:56:57 -0800 Subject: Fixing issues caused by changing test emails --- model/client.go | 2 +- model/utils_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'model') diff --git a/model/client.go b/model/client.go index ac85b0d1c..d3f76817d 100644 --- a/model/client.go +++ b/model/client.go @@ -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), diff --git a/model/utils_test.go b/model/utils_test.go index 6d6f9e653..aab535fc9 100644 --- a/model/utils_test.go +++ b/model/utils_test.go @@ -70,7 +70,7 @@ func TestValidLower(t *testing.T) { t.Error("should be valid") } - if IsLower("corey+test@hulen.com") { + if IsLower("Corey+test@hulen.com") { t.Error("should be invalid") } } -- cgit v1.2.3-1-g7c22