File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ var UserSchema = new Schema({
3737} ) ;
3838
3939UserSchema . virtual ( 'avatar_url' ) . get ( function ( ) {
40- return this . profile_image_url || this . avatar || config . site_static_host + '/public/images/user_icon&48.png' ;
40+ var url = this . profile_image_url || this . avatar || config . site_static_host + '/public/images/user_icon&48.png' ;
41+ return url . replace ( 'http://www.gravatar.com/' , 'http://gravatar.qiniudn.com/' ) ;
4142} ) ;
4243
4344mongoose . model ( 'User' , UserSchema ) ;
Original file line number Diff line number Diff line change 55 "private" : true ,
66 "customHost" : [" cnodejs.org" , " club.cnodejs.org" ],
77 "dependencies" : {
8- "express" : " 2.5.1 " ,
8+ "express" : " 2.5.11 " ,
99 "ejs" : " 0.8.4" ,
1010 "eventproxy" : " 0.2.5" ,
1111 "mongoose" : " 2.7.3" ,
Original file line number Diff line number Diff line change 1+ /*!
2+ * nodeclub - test/controllers/topic.js
3+ * Copyright(c) 2013 fengmk2 <fengmk2@gmail.com>
4+ * MIT Licensed
5+ */
6+
7+ "use strict" ;
8+
9+ /**
10+ * Module dependencies.
11+ */
12+
113var should = require ( 'should' ) ;
14+ var request = require ( 'supertest' ) ;
215var app = require ( '../../app' ) ;
316
417describe ( 'controllers/topic.js' , function ( ) {
@@ -10,14 +23,20 @@ describe('controllers/topic.js', function () {
1023 app . close ( ) ;
1124 } ) ;
1225
13- describe ( 'index ' , function ( ) {
26+ describe ( '/topic ' , function ( ) {
1427 it ( 'should ok' , function ( done ) {
15- app . request ( ) . get ( '/topic/inexist' ) . end ( function ( res ) {
16- res . should . status ( 200 ) ;
17- var body = res . body . toString ( ) ;
18- body . should . include ( '此话题不存在或已被删除。' ) ;
19- done ( ) ;
20- } ) ;
28+ request ( app )
29+ . get ( '/topic/inexist' )
30+ . expect ( 200 )
31+ . expect ( / 此 话 题 不 存 在 或 已 被 删 除 / , done ) ;
32+ } ) ;
33+ } ) ;
34+
35+ describe ( '/user/$name/replies' , function ( ) {
36+ it ( 'should GET /user/lzghades/replies?page=1 %27%27%29%29%28%27%27%29%27%28 status 200' , function ( done ) {
37+ request ( app )
38+ . get ( '/user/lzghades/replies?page=1 %27%27%29%29%28%27%27%29%27%28 ' )
39+ . expect ( 200 , done ) ;
2140 } ) ;
2241 } ) ;
2342} ) ;
You can’t perform that action at this time.
0 commit comments