mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-14 11:23:02 +02:00
11bf8c365a
* Fixed headers * Added e2e for static pages
28 lines
645 B
Go
28 lines
645 B
Go
package drivers_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
"github.com/MontFerret/ferret/pkg/drivers"
|
|
)
|
|
|
|
func TestHTTPHeader(t *testing.T) {
|
|
Convey("HTTPHeaders", t, func() {
|
|
Convey(".MarshalJSON", func() {
|
|
Convey("Should serialize header values", func() {
|
|
headers := make(drivers.HTTPHeaders)
|
|
|
|
headers["Content-Encoding"] = []string{"gzip"}
|
|
headers["Content-Type"] = []string{"text/html", "charset=utf-8"}
|
|
|
|
out, err := headers.MarshalJSON()
|
|
|
|
So(err, ShouldBeNil)
|
|
So(string(out), ShouldEqual, `{"Content-Encoding":"gzip","Content-Type":"text/html, charset=utf-8"}`)
|
|
})
|
|
})
|
|
})
|
|
}
|