Integration tests (#71)
This commit is contained in:
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user