This commit is contained in:
Nikita Koryabkin 2019-12-03 10:21:24 +03:00
parent ed05d4b381
commit 6a0d065664

View File

@ -747,9 +747,9 @@ func TestFindOrCreate(t *testing.T) {
[]sql.NamedArg{
{Name: "age", Value: 26},
{Name: "credit_card", Value: CreditCard{Number: "4344387492301351"}},
{Name: "emails", Value: []Email{{Email: "Nikita@Koryabk.in"}}},
{Name: "emails", Value: []Email{{Email: "test@example.com"}}},
}).FirstOrCreate(&user9)
if DB.Where("email = ?", "Nikita@Koryabk.in").First(&Email{}).RecordNotFound() {
if DB.Where("email = ?", "test@example.com").First(&Email{}).RecordNotFound() {
t.Errorf("embedded struct email should be saved")
}