1
0

Integration tests (#71)

This commit is contained in:
konrad
2019-04-21 18:18:17 +00:00
committed by Gitea
parent 46efcb1005
commit 3872d1d8a7
69 changed files with 3924 additions and 136 deletions

View File

@ -20,6 +20,7 @@ package models
import (
"code.vikunja.io/web"
"gopkg.in/d4l3k/messagediff.v1"
"reflect"
"runtime"
"testing"
@ -160,7 +161,8 @@ func TestNamespaceUser_ReadAll(t *testing.T) {
User: User{
ID: 1,
Username: "user1",
Password: "1234",
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
IsActive: true,
},
Right: RightRead,
},
@ -168,7 +170,7 @@ func TestNamespaceUser_ReadAll(t *testing.T) {
User: User{
ID: 2,
Username: "user2",
Password: "1234",
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
},
Right: RightRead,
},
@ -206,8 +208,8 @@ func TestNamespaceUser_ReadAll(t *testing.T) {
if (err != nil) && tt.wantErr && !tt.errType(err) {
t.Errorf("NamespaceUser.ReadAll() Wrong error type! Error = %v, want = %v", err, runtime.FuncForPC(reflect.ValueOf(tt.errType).Pointer()).Name())
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("NamespaceUser.ReadAll() = %v, want %v", got, tt.want)
if diff, equal := messagediff.PrettyDiff(got, tt.want); !equal {
t.Errorf("NamespaceUser.ReadAll() = %v, want %v, diff: %v", got, tt.want, diff)
}
})
}