mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-06-29 00:21:53 +02:00
Adds test for authentication on expected json. Adds test to metaissue
This commit is contained in:
@ -410,6 +410,40 @@ func TestMetaIssueTypes_GetMandatoryFields(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestMetaIssueTypes_GetMandatoryFields_NonExistentRequiredKey_Fail(t *testing.T) {
|
||||
data := make(map[string]interface{})
|
||||
|
||||
data["summary"] = map[string]interface{}{
|
||||
"name": "Summary",
|
||||
}
|
||||
|
||||
m := new(MetaIssueTypes)
|
||||
m.Fields = data
|
||||
|
||||
_, err := m.GetMandatoryFields()
|
||||
if err == nil {
|
||||
t.Error("Expected non nil errpr, recieved nil")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestMetaIssueTypes_GetMandatoryFields_NonExistentNameKey_Fail(t *testing.T) {
|
||||
data := make(map[string]interface{})
|
||||
|
||||
data["summary"] = map[string]interface{}{
|
||||
"required": true,
|
||||
}
|
||||
|
||||
m := new(MetaIssueTypes)
|
||||
m.Fields = data
|
||||
|
||||
_, err := m.GetMandatoryFields()
|
||||
if err == nil {
|
||||
t.Error("Expected non nil errpr, recieved nil")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestMetaIssueTypes_GetAllFields(t *testing.T) {
|
||||
data := make(map[string]interface{})
|
||||
|
||||
@ -443,6 +477,23 @@ func TestMetaIssueTypes_GetAllFields(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestMetaIssueTypes_GetAllFields_NonExistingNameKey_Fail(t *testing.T) {
|
||||
data := make(map[string]interface{})
|
||||
|
||||
data["summary"] = map[string]interface{}{
|
||||
"required": true,
|
||||
}
|
||||
|
||||
m := new(MetaIssueTypes)
|
||||
m.Fields = data
|
||||
|
||||
_, err := m.GetAllFields()
|
||||
if err == nil {
|
||||
t.Error("Expected non nil error, recieved nil")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestCreateMetaInfo_GetProjectName_Success(t *testing.T) {
|
||||
metainfo := new(CreateMetaInfo)
|
||||
metainfo.Projects = append(metainfo.Projects, &MetaProject{
|
||||
|
Reference in New Issue
Block a user