mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 20:41:57 +00:00
add test for JSONP
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
// Contains tests for render/rest
|
// Contains tests for render/rest & render/template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
@@ -68,9 +68,9 @@ func TestREST(t *testing.T) {
|
|||||||
textT.Header("Content-Type").Equal("text/plain; charset=UTF-8")
|
textT.Header("Content-Type").Equal("text/plain; charset=UTF-8")
|
||||||
textT.Body().Equal(textContents)
|
textT.Body().Equal(textContents)
|
||||||
|
|
||||||
/* JSONPT := e.GET("/jsonp").Expect()
|
JSONPT := e.GET("/jsonp").Expect()
|
||||||
dataT.Header("Content-Type").Equal("application/javascript; charset=UTF-8")
|
JSONPT.Header("Content-Type").Equal("application/javascript; charset=UTF-8")
|
||||||
dataT.Body().Equal(dataContents)*/
|
JSONPT.Body().Equal(JSONPCallback + `({"hello":"jsonp"});`)
|
||||||
|
|
||||||
JSONT := e.GET("/json").Expect()
|
JSONT := e.GET("/json").Expect()
|
||||||
JSONT.Header("Content-Type").Equal("application/json; charset=UTF-8")
|
JSONT.Header("Content-Type").Equal("application/json; charset=UTF-8")
|
||||||
|
|||||||
Reference in New Issue
Block a user