@@ -8,11 +8,12 @@ http = require "../test/support/http"
8
8
describe ' REST-Sessions Test' , ->
9
9
10
10
before (done ) ->
11
- http .createServer (app,done)
11
+ http .createServer (app, done)
12
12
return
13
13
14
14
after (done ) ->
15
- done ()
15
+ done ()
16
+ process .exit (0 )
16
17
return
17
18
18
19
token1 = null
@@ -31,7 +32,7 @@ describe 'REST-Sessions Test', ->
31
32
32
33
it ' PUT /TestApp/create/user1 should return 200 and a token' , (done ) ->
33
34
http .request ().put (' /TestApp/create/user1?ip=127.0.0.1' )
34
- .set (' Content-Type' ,' application/json' )
35
+ .set (' Content-Type' , ' application/json' )
35
36
.write (JSON .stringify ({ blarg : " foo" }))
36
37
.end (resp) ->
37
38
resp .statusCode .should .equal (200 )
@@ -75,8 +76,8 @@ describe 'REST-Sessions Test', ->
75
76
76
77
it ' POST /TestApp/set/{token} set some data' , (done ) ->
77
78
http .request ().post (' /TestApp/set/' + token1)
78
- .set (' Content-Type' ,' application/json' )
79
- .write (JSON .stringify ({ somebool : true , account : 120.55 , name : " Peter Smith" }))
79
+ .set (' Content-Type' , ' application/json' )
80
+ .write (JSON .stringify ({ somebool : true , account : 120.55 , name : " Peter Smith" }))
80
81
.end (resp) ->
81
82
resp .statusCode .should .equal (200 )
82
83
body = JSON .parse (resp .body )
@@ -89,7 +90,7 @@ describe 'REST-Sessions Test', ->
89
90
return
90
91
91
92
it ' DELETE /TestApp/kill should return 200 ' , (done ) ->
92
- http .request ().delete (' /TestApp/kill/' + token2).expect (200 ,done)
93
+ http .request ().delete (' /TestApp/kill/' + token2).expect (200 , done)
93
94
return
94
95
95
96
it ' GET /TestApp/activity should return 200 and 1 session' , (done ) ->
@@ -158,7 +159,7 @@ describe 'REST-Sessions Test', ->
158
159
return
159
160
160
161
it ' GET /TestApp/soid/user2 should return 200 and 2 sessions' , (done ) ->
161
- http .request ().get (' /TestApp/soid/' + user2 .id ).end (resp) ->
162
+ http .request ().get (' /TestApp/soid/' + user2 .id ).end (resp) ->
162
163
resp .statusCode .should .equal (200 )
163
164
body = JSON .parse (resp .body )
164
165
body .sessions .length .should .equal (2 )
@@ -168,7 +169,7 @@ describe 'REST-Sessions Test', ->
168
169
169
170
170
171
it ' DELETE /TestApp/killsoid/user2 should return 200 ' , (done ) ->
171
- http .request ().delete (' /TestApp/killsoid/' + user2 .id ).expect (200 ,done)
172
+ http .request ().delete (' /TestApp/killsoid/' + user2 .id ).expect (200 , done)
172
173
return
173
174
174
175
it ' GET /TestApp/activity should return 200 and equal 1' , (done ) ->
@@ -182,7 +183,7 @@ describe 'REST-Sessions Test', ->
182
183
183
184
184
185
it ' DELETE /TestApp/killall should return 200 ' , (done ) ->
185
- http .request ().delete (' /TestApp/killall' ).expect (200 ,done)
186
+ http .request ().delete (' /TestApp/killall' ).expect (200 , done)
186
187
return
187
188
188
189
0 commit comments