Loading controllers/isogrids/banner_test.go +22 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ func TestBannerRandom(t *testing.T) { r := new(route.Router) r.HandleFunc("/isogrids/banner/random", BannerRandom) test := tgTesting.GenerateHandlerFunc(t, Hexa) test := tgTesting.GenerateHandlerFunc(t, BannerRandom) for _, p := range tgTesting.GoodParams { recorder := test("/isogrids/banner/random", "GET", p, r) if recorder.Code != http.StatusOK { Loading @@ -28,3 +28,24 @@ func TestBannerRandom(t *testing.T) { } } } func TestBannerRandomGradient(t *testing.T) { r := new(route.Router) r.HandleFunc("/isogrids/banner/random/gradient", BannerRandomGradient) test := tgTesting.GenerateHandlerFunc(t, BannerRandomGradient) for _, p := range tgTesting.GoodParams { recorder := test("/isogrids/banner/random/gradient", "GET", p, r) if recorder.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", recorder.Code, http.StatusOK) } } for _, p := range tgTesting.BadParams { recorder := test("/isogrids/banner/random/gradient", "GET", p, r) if recorder.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", recorder.Code, http.StatusOK) } } } testing/testing.go +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ func init() { `{"theme":"frogideas"}`, `{"w":"500", "h":"100"}`, `{"xs":"500"}`, `{"xt":"500"}`, } BadParams = []string{ Loading @@ -31,6 +32,7 @@ func init() { `{"theme":"wrongTheme"}`, `{"w":"wrongW", "h":"wrongH"}`, `{"xs":"wrongXS"}`, `{"xt":"wrongXT"}`, } } Loading Loading
controllers/isogrids/banner_test.go +22 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ func TestBannerRandom(t *testing.T) { r := new(route.Router) r.HandleFunc("/isogrids/banner/random", BannerRandom) test := tgTesting.GenerateHandlerFunc(t, Hexa) test := tgTesting.GenerateHandlerFunc(t, BannerRandom) for _, p := range tgTesting.GoodParams { recorder := test("/isogrids/banner/random", "GET", p, r) if recorder.Code != http.StatusOK { Loading @@ -28,3 +28,24 @@ func TestBannerRandom(t *testing.T) { } } } func TestBannerRandomGradient(t *testing.T) { r := new(route.Router) r.HandleFunc("/isogrids/banner/random/gradient", BannerRandomGradient) test := tgTesting.GenerateHandlerFunc(t, BannerRandomGradient) for _, p := range tgTesting.GoodParams { recorder := test("/isogrids/banner/random/gradient", "GET", p, r) if recorder.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", recorder.Code, http.StatusOK) } } for _, p := range tgTesting.BadParams { recorder := test("/isogrids/banner/random/gradient", "GET", p, r) if recorder.Code != http.StatusOK { t.Errorf("returned %v. Expected %v.", recorder.Code, http.StatusOK) } } }
testing/testing.go +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ func init() { `{"theme":"frogideas"}`, `{"w":"500", "h":"100"}`, `{"xs":"500"}`, `{"xt":"500"}`, } BadParams = []string{ Loading @@ -31,6 +32,7 @@ func init() { `{"theme":"wrongTheme"}`, `{"w":"wrongW", "h":"wrongH"}`, `{"xs":"wrongXS"}`, `{"xt":"wrongXT"}`, } } Loading