@@ -41,65 +41,65 @@ var userIndex = proxyquire('./index', {
41
41
describe ( 'User API Router:' , function ( ) {
42
42
43
43
it ( 'should return an express router instance' , function ( ) {
44
- userIndex . should . equal ( routerStub ) ;
44
+ < %= expect ( ) % > userIndex < %= to ( ) % > . equal ( routerStub ) ;
45
45
} ) ;
46
46
47
47
describe ( 'GET /api/users' , function ( ) {
48
48
49
49
it ( 'should verify admin role and route to user.controller.index' , function ( ) {
50
- routerStub . get
51
- . withArgs ( '/' , 'authService.hasRole.admin' , 'userCtrl.index' )
52
- . should . have . been . calledOnce ;
50
+ < %= expect ( ) % > routerStub . get
51
+ . withArgs ( '/' , 'authService.hasRole.admin' , 'userCtrl.index' )
52
+ < %= to ( ) % > . have . been . calledOnce ;
53
53
} ) ;
54
54
55
55
} ) ;
56
56
57
57
describe ( 'DELETE /api/users/:id' , function ( ) {
58
58
59
59
it ( 'should verify admin role and route to user.controller.destroy' , function ( ) {
60
- routerStub . delete
61
- . withArgs ( '/:id' , 'authService.hasRole.admin' , 'userCtrl.destroy' )
62
- . should . have . been . calledOnce ;
60
+ < %= expect ( ) % > routerStub . delete
61
+ . withArgs ( '/:id' , 'authService.hasRole.admin' , 'userCtrl.destroy' )
62
+ < %= to ( ) % > . have . been . calledOnce ;
63
63
} ) ;
64
64
65
65
} ) ;
66
66
67
67
describe ( 'GET /api/users/me' , function ( ) {
68
68
69
69
it ( 'should be authenticated and route to user.controller.me' , function ( ) {
70
- routerStub . get
71
- . withArgs ( '/me' , 'authService.isAuthenticated' , 'userCtrl.me' )
72
- . should . have . been . calledOnce ;
70
+ < %= expect ( ) % > routerStub . get
71
+ . withArgs ( '/me' , 'authService.isAuthenticated' , 'userCtrl.me' )
72
+ < %= to ( ) % > . have . been . calledOnce ;
73
73
} ) ;
74
74
75
75
} ) ;
76
76
77
77
describe ( 'PUT /api/users/:id/password' , function ( ) {
78
78
79
79
it ( 'should be authenticated and route to user.controller.changePassword' , function ( ) {
80
- routerStub . put
81
- . withArgs ( '/:id/password' , 'authService.isAuthenticated' , 'userCtrl.changePassword' )
82
- . should . have . been . calledOnce ;
80
+ < %= expect ( ) % > routerStub . put
81
+ . withArgs ( '/:id/password' , 'authService.isAuthenticated' , 'userCtrl.changePassword' )
82
+ < %= to ( ) % > . have . been . calledOnce ;
83
83
} ) ;
84
84
85
85
} ) ;
86
86
87
87
describe ( 'GET /api/users/:id' , function ( ) {
88
88
89
89
it ( 'should be authenticated and route to user.controller.show' , function ( ) {
90
- routerStub . get
91
- . withArgs ( '/:id' , 'authService.isAuthenticated' , 'userCtrl.show' )
92
- . should . have . been . calledOnce ;
90
+ < %= expect ( ) % > routerStub . get
91
+ . withArgs ( '/:id' , 'authService.isAuthenticated' , 'userCtrl.show' )
92
+ < %= to ( ) % > . have . been . calledOnce ;
93
93
} ) ;
94
94
95
95
} ) ;
96
96
97
97
describe ( 'POST /api/users' , function ( ) {
98
98
99
99
it ( 'should route to user.controller.create' , function ( ) {
100
- routerStub . post
101
- . withArgs ( '/' , 'userCtrl.create' )
102
- . should . have . been . calledOnce ;
100
+ < %= expect ( ) % > routerStub . post
101
+ . withArgs ( '/' , 'userCtrl.create' )
102
+ < %= to ( ) % > . have . been . calledOnce ;
103
103
} ) ;
104
104
105
105
} ) ;
0 commit comments