iris/_examples/i18n/template/main_test.go
Gerasimos (Makis) Maropoulos 7b6a8f1e26
simplify some examples
2020-11-07 12:49:14 +02:00

22 lines
612 B
Go

package main
import (
"testing"
"github.com/kataras/iris/v12/httptest"
)
func TestI18nLoaderFuncMap(t *testing.T) {
app := newApp()
e := httptest.New(t, app)
e.GET("/").Expect().Status(httptest.StatusOK).
Body().Equal("Become a MEMBER")
e.GET("/title").Expect().Status(httptest.StatusOK).
Body().Equal("Account Connections")
e.GET("/").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
Body().Equal("Γίνε ΜΈΛΟΣ")
e.GET("/title").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
Body().Equal("Λογαριασμός Συνδέσεις")
}