package model

import "testing"

func TestProjectAssetBeforeCreateInitializesJSONFields(t *testing.T) {
	asset := &ProjectAsset{}
	if err := asset.BeforeCreate(nil); err != nil {
		t.Fatalf("BeforeCreate returned error: %v", err)
	}
	if string(asset.Appearances) != "[]" {
		t.Fatalf("unexpected appearances default: %s", asset.Appearances)
	}
	if string(asset.Aliases) != "[]" {
		t.Fatalf("unexpected aliases default: %s", asset.Aliases)
	}
	if string(asset.Attributes) != "{}" {
		t.Fatalf("unexpected attributes default: %s", asset.Attributes)
	}
}
