(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func TestHasOneAssociationWithSelect(t *testing.T) { |
| 87 | user := *GetUser("hasone", Config{Account: true}) |
| 88 | |
| 89 | DB.Omit("Account.Number").Create(&user) |
| 90 | |
| 91 | AssertAssociationCount(t, user, "Account", 1, "") |
| 92 | |
| 93 | var account Account |
| 94 | DB.Model(&user).Association("Account").Find(&account) |
| 95 | if account.Number != "" { |
| 96 | t.Errorf("account's number should not be saved") |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func TestHasOneAssociationForSlice(t *testing.T) { |
| 101 | users := []User{ |
nothing calls this directly
no test coverage detected