mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
fix(be): test for register user
This commit is contained in:
parent
06900e8160
commit
5860e1378b
@ -86,13 +86,21 @@ func TestAuthRegister2(t *testing.T) {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
store := createStore()
|
||||
|
||||
err = store.CreatePlaceholderUser()
|
||||
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
req, _ := http.NewRequest("POST", "/api/auth/register", bytes.NewBuffer(body))
|
||||
rr := httptest.NewRecorder()
|
||||
|
||||
r := Route()
|
||||
r.Use(func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
context.Set(r, "store", createStore())
|
||||
context.Set(r, "store", store)
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
})
|
||||
|
@ -1,8 +1,10 @@
|
||||
package db
|
||||
|
||||
type Schedule struct {
|
||||
ID int `db:"id" json:"id"`
|
||||
ProjectID int `db:"project_id" json:"project_id"`
|
||||
TemplateID int `db:"template_id" json:"template_id"`
|
||||
CronFormat string `db:"cron_format" json:"cron_format"`
|
||||
ID int `db:"id" json:"id"`
|
||||
ProjectID int `db:"project_id" json:"project_id"`
|
||||
TemplateID int `db:"template_id" json:"template_id"`
|
||||
CronFormat string `db:"cron_format" json:"cron_format"`
|
||||
RepositoryID *int `db:"repository_id" json:"repository_id"`
|
||||
LastCommitHash *string `db:"last_commit_hash" json:"last_commit_hash"`
|
||||
}
|
||||
|
@ -44,6 +44,8 @@ type Template struct {
|
||||
ViewID *int `db:"view_id" json:"view_id"`
|
||||
|
||||
LastTask *TaskWithTpl `db:"-" json:"last_task"`
|
||||
|
||||
Autorun bool `db:"autorun" json:"-"`
|
||||
}
|
||||
|
||||
func (tpl *Template) Validate() error {
|
||||
|
Loading…
Reference in New Issue
Block a user