@@ -14,7 +14,7 @@ describe('routes/auth/test.js', function() {
1414 } )
1515 . end ( function ( err , res ) {
1616 should . not . exist ( err ) ;
17- res . text . should . containEql ( `{"status":"ERROR","errorMessage":"请您输入邮箱地址"}` ) ;
17+ res . text . should . equal ( `{"status":"ERROR","errorMessage":"请您输入邮箱地址"}` ) ;
1818 done ( ) ;
1919 } ) ;
2020 } ) ;
@@ -26,7 +26,7 @@ describe('routes/auth/test.js', function() {
2626 } )
2727 . end ( function ( err , res ) {
2828 should . not . exist ( err ) ;
29- res . text . should . containEql ( `{"status":"ERROR","errorMessage":"您输入的邮箱或密码有误"}` ) ;
29+ res . text . should . equal ( `{"status":"ERROR","errorMessage":"您输入的邮箱或密码有误"}` ) ;
3030 done ( ) ;
3131 } ) ;
3232 } ) ;
@@ -38,7 +38,7 @@ describe('routes/auth/test.js', function() {
3838 } )
3939 . end ( function ( err , res ) {
4040 should . not . exist ( err ) ;
41- res . text . should . containEql ( `{"status":"ERROR","errorMessage":"您输入的邮箱或密码有误"}` ) ;
41+ res . text . should . equal ( `{"status":"ERROR","errorMessage":"您输入的邮箱或密码有误"}` ) ;
4242 done ( ) ;
4343 } ) ;
4444 } ) ;
@@ -50,9 +50,31 @@ describe('routes/auth/test.js', function() {
5050 } )
5151 . end ( function ( err , res ) {
5252 should . not . exist ( err ) ;
53- JSON . parse ( res . text ) . status . should . containEql ( 'OK' )
53+ JSON . parse ( res . text ) . status . should . equal ( 'OK' )
5454 done ( ) ;
5555 } ) ;
5656 } ) ;
57- } )
57+ } ) ;
58+
59+ describe ( 'logout' , function ( done ) {
60+ it ( 'should logout successful' , function ( done ) {
61+ request . post ( '/auth/logout' )
62+ . end ( function ( err , res ) {
63+ should . not . exist ( err ) ;
64+ res . text . should . equal ( 'ok' ) ;
65+ done ( ) ;
66+ } ) ;
67+ } ) ;
68+ } ) ;
69+
70+ describe ( 'link' , function ( done ) {
71+ it ( 'should link successful' , function ( done ) {
72+ request . get ( '/auth/link' )
73+ . end ( function ( err , res ) {
74+ should . not . exist ( err ) ;
75+ res . headers . location . should . equal ( '/auth/login' ) ;
76+ done ( ) ;
77+ } ) ;
78+ } ) ;
79+ } ) ;
5880} ) ;
0 commit comments