add test to make sure IssueType.Fields does not disappear on regeneration

This commit is contained in:
Cory Bennett
2017-10-28 12:28:25 -07:00
parent 794f8dd259
commit 3966defc53
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -48,10 +48,10 @@ package jiradata
type IssueType struct {
AvatarID int `json:"avatarId,omitempty" yaml:"avatarId,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Fields FieldMetaMap `json:"fields,omitempty" yaml:"fields,omitempty"`
IconURL string `json:"iconUrl,omitempty" yaml:"iconUrl,omitempty"`
ID string `json:"id,omitempty" yaml:"id,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Self string `json:"self,omitempty" yaml:"self,omitempty"`
Subtask bool `json:"subtask,omitempty" yaml:"subtask,omitempty"`
Fields FieldMetaMap `json:"fields,omitempty" yaml:"fields,omitempty"`
}
+14
View File
@@ -0,0 +1,14 @@
package jiradata
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestIssueTypeFields(t *testing.T) {
// this is because schema is wrong, missing the 'Fields' arguments, so we manually add it.
// If the jiradata is regenerated we need to manually make the change again to include:
// Fields FieldMetaMap `json:"fields,omitempty" yaml:"fields,omitempty"`
assert.IsType(t, FieldMetaMap{}, IssueType{}.Fields)
}