2018-11-17 05:21:39 +00:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/jinzhu/gorm"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewConfig(t *testing.T) {
|
|
|
|
c := NewConfig()
|
|
|
|
|
|
|
|
assert.IsType(t, new(Config), c)
|
|
|
|
|
|
|
|
assert.Equal(t, AssetsPath, c.GetAssetsPath())
|
2018-12-21 01:49:45 +00:00
|
|
|
assert.False(t, c.Debug())
|
2018-11-17 05:21:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestConfig_ConnectToDatabase(t *testing.T) {
|
|
|
|
c := NewConfig()
|
|
|
|
|
2018-12-21 01:37:16 +00:00
|
|
|
db := c.Db()
|
2018-11-17 05:21:39 +00:00
|
|
|
|
|
|
|
assert.IsType(t, &gorm.DB{}, db)
|
2018-11-17 05:56:43 +00:00
|
|
|
}
|