gr
This commit is contained in:
@@ -79,10 +79,10 @@ func TestRunHTTP(t *testing.T) {
|
||||
if w.Code != http.StatusOK {
|
||||
t.Error(w.Code)
|
||||
}
|
||||
var result []string
|
||||
var result []Question
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &result); err != nil {
|
||||
t.Error(err)
|
||||
} else if fmt.Sprint(result) != fmt.Sprint([]string{"0"}) {
|
||||
} else if fmt.Sprint(result) != fmt.Sprint([]Question{{ID: "0", Live: false, Closed: false, Text: "QUESTION TEXT", Options: []string{"X", "Y"}}}) {
|
||||
t.Error(result)
|
||||
}
|
||||
})
|
||||
@@ -100,7 +100,7 @@ func TestRunHTTP(t *testing.T) {
|
||||
var result Question
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &result); err != nil {
|
||||
t.Error(err)
|
||||
} else if fmt.Sprint(result) != fmt.Sprint(Question{Text: "QUESTION TEXT", Options: []string{"X", "Y"}}) {
|
||||
} else if fmt.Sprint(result) != fmt.Sprint(Question{ID: "0", Text: "QUESTION TEXT", Options: []string{"X", "Y"}}) {
|
||||
t.Error(result)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user