diff --git a/gorm_test.go b/gorm_test.go index 472df1f2..816b47cb 100644 --- a/gorm_test.go +++ b/gorm_test.go @@ -166,6 +166,10 @@ func TestCreateAndUpdate(t *testing.T) { t.Error("User should be new record") } + if !db.NewRecord(&user) { + t.Error("User should be new record") + } + db.Save(&user) if user.Id == 0 { t.Errorf("Should have ID after create") @@ -175,6 +179,10 @@ func TestCreateAndUpdate(t *testing.T) { t.Error("User should not new record after save") } + if db.NewRecord(&user) { + t.Error("User should not new record after save") + } + var u User db.First(&u, user.Id) if !reflect.DeepEqual(u.PasswordHash, []byte{'f', 'a', 'k', '4'}) {