From 08b4851fc8daf9ea7515aeb9fbf7f95e3060985c Mon Sep 17 00:00:00 2001 From: kunw Date: Fri, 28 Oct 2016 16:50:40 +0800 Subject: [PATCH] Updates for controller test cases. --- src/ui/controllers/controllers_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ui/controllers/controllers_test.go b/src/ui/controllers/controllers_test.go index b4cb4fe2c..c80377417 100644 --- a/src/ui/controllers/controllers_test.go +++ b/src/ui/controllers/controllers_test.go @@ -112,20 +112,17 @@ func TestMain(t *testing.T) { r, _ = http.NewRequest("GET", "/account_setting", nil) w = httptest.NewRecorder() beego.BeeApp.Handlers.ServeHTTP(w, r) - assert.Equal(int(200), w.Code, "'/account_setting' httpStatusCode should be 200") - assert.Equal(true, strings.Contains(fmt.Sprintf("%s", w.Body), "page_title_account_setting"), "http respond should have 'page_title_account_setting'") + assert.Equal(int(302), w.Code, "'/account_setting' httpStatusCode should be 302") r, _ = http.NewRequest("GET", "/change_password", nil) w = httptest.NewRecorder() beego.BeeApp.Handlers.ServeHTTP(w, r) - assert.Equal(int(200), w.Code, "'/change_password' httpStatusCode should be 200") - assert.Equal(true, strings.Contains(fmt.Sprintf("%s", w.Body), "page_title_change_password"), "http respond should have 'page_title_change_password'") + assert.Equal(int(302), w.Code, "'/change_password' httpStatusCode should be 302") r, _ = http.NewRequest("GET", "/admin_option", nil) w = httptest.NewRecorder() beego.BeeApp.Handlers.ServeHTTP(w, r) - assert.Equal(int(200), w.Code, "'/admin_option' httpStatusCode should be 200") - assert.Equal(true, strings.Contains(fmt.Sprintf("%s", w.Body), "page_title_admin_option"), "http respond should have 'page_title_admin_option'") + assert.Equal(int(302), w.Code, "'/admin_option' httpStatusCode should be 302") r, _ = http.NewRequest("GET", "/forgot_password", nil) w = httptest.NewRecorder()