* Migrate admin functions into app package

* More user function refactoring

* Move post functions into app package
Этот коммит содержится в:
Joram Wilander
2017-01-25 09:32:42 -05:00
коммит произвёл Harrison Healey
родитель 8ed665cb76
Коммит d245b29f82
24 изменённых файлов: 1466 добавлений и 1081 удалений

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

@@ -83,32 +83,6 @@ func TestCreateUser(t *testing.T) {
}
}
func TestCheckUserDomain(t *testing.T) {
th := Setup().InitBasic()
user := th.BasicUser
cases := []struct {
domains string
matched bool
}{
{"simulator.amazonses.com", true},
{"gmail.com", false},
{"", true},
{"gmail.com simulator.amazonses.com", true},
}
for _, c := range cases {
matched := CheckUserDomain(user, c.domains)
if matched != c.matched {
if c.matched {
t.Logf("'%v' should have matched '%v'", user.Email, c.domains)
} else {
t.Logf("'%v' should not have matched '%v'", user.Email, c.domains)
}
t.FailNow()
}
}
}
func TestLogin(t *testing.T) {
th := Setup().InitBasic()
Client := th.BasicClient
@@ -1356,6 +1330,7 @@ func TestResetPassword(t *testing.T) {
}
if _, err := Client.ResetPassword(recovery.Code, "newpwd1"); err != nil {
t.Log(recovery.Code)
t.Fatal(err)
}