aboutsummaryrefslogtreecommitdiffstats
path: root/models/models_test.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-27 12:48:29 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-27 12:48:29 -0400
commit3144fac03cb468aa28c0ade7687b1d4df1de6abb (patch)
treecb17846a0d9ca04f3cdfc0d5d27d25c4ff09bce7 /models/models_test.go
parent442996f03200e5c8dce6f8d428426e8a6c3db051 (diff)
downloadgitea-3144fac03cb468aa28c0ade7687b1d4df1de6abb.tar.gz
gitea-3144fac03cb468aa28c0ade7687b1d4df1de6abb.zip
IP: RC Code Review
Diffstat (limited to 'models/models_test.go')
-rw-r--r--models/models_test.go23
1 files changed, 14 insertions, 9 deletions
diff --git a/models/models_test.go b/models/models_test.go
index d0f734d678..b808f41d21 100644
--- a/models/models_test.go
+++ b/models/models_test.go
@@ -10,12 +10,12 @@ import (
"github.com/lunny/xorm"
_ "github.com/mattn/go-sqlite3"
+ . "github.com/smartystreets/goconvey/convey"
+
+ "github.com/gogits/gogs/modules/base"
)
func init() {
- LoadModelsConfig()
- NewEngine()
-
var err error
orm, err = xorm.NewEngine("sqlite3", "./test.db")
if err != nil {
@@ -25,26 +25,31 @@ func init() {
orm.ShowSQL = true
orm.ShowDebug = true
- err = orm.Sync(&User{}, &Repo{})
+ err = orm.Sync(&User{}, &Repository{})
if err != nil {
fmt.Println(err)
}
- root = "test"
+ base.RepoRootPath = "test"
}
func TestCreateRepository(t *testing.T) {
- user := User{Id: 1, Type: Individual}
- _, err := CreateRepository(&user, "test")
+ user := User{Id: 1, Name: "foobar", Type: UT_INDIVIDUAL}
+ _, err := CreateRepository(&user, "test", "", "", "test repo desc", false, false)
if err != nil {
t.Error(err)
}
}
func TestDeleteRepository(t *testing.T) {
- user := User{Id: 1, Type: Individual}
- err := DeleteRepository(&user, "test")
+ err := DeleteRepository(1, 1, "foobar")
if err != nil {
t.Error(err)
}
}
+
+func TestCommitRepoAction(t *testing.T) {
+ Convey("Create a commit repository action", t, func() {
+
+ })
+}