2018-11-17 06:21:39 +01: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)
|
|
|
|
|
2018-12-21 03:25:09 +01:00
|
|
|
assert.Equal(t, AssetsPath, c.AssetsPath())
|
2018-12-21 02:49:45 +01:00
|
|
|
assert.False(t, c.Debug())
|
2018-11-17 06:21:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestConfig_ConnectToDatabase(t *testing.T) {
|
|
|
|
c := NewConfig()
|
|
|
|
|
2018-12-21 02:37:16 +01:00
|
|
|
db := c.Db()
|
2018-11-17 06:21:39 +01:00
|
|
|
|
|
|
|
assert.IsType(t, &gorm.DB{}, db)
|
2018-11-17 06:56:43 +01:00
|
|
|
}
|