@@ -62,7 +62,7 @@ describe 'Role Scopes REST Routes', ->
62
62
res .statusCode .should .equal 401
63
63
64
64
it ' should respond "Unauthorized"' , ->
65
- res .text .should .equal ' Unauthorized'
65
+ res .text .should .contain ' Unauthorized'
66
66
67
67
68
68
describe ' by default' , ->
@@ -158,7 +158,7 @@ describe 'Role Scopes REST Routes', ->
158
158
res .headers [' content-type' ].should .contain ' text/html'
159
159
160
160
it ' should respond with "Not found" error' , ->
161
- res .text .should .equal ' Not found.'
161
+ res .text .should .contain ' Not found.'
162
162
163
163
164
164
@@ -182,13 +182,15 @@ describe 'Role Scopes REST Routes', ->
182
182
res .statusCode .should .equal 401
183
183
184
184
it ' should respond "Unauthorized"' , ->
185
- res .text .should .equal ' Unauthorized'
185
+ res .text .should .contain ' Unauthorized'
186
186
187
187
188
188
describe ' with valid data' , ->
189
189
190
190
before (done ) ->
191
191
role = new Role
192
+ role .addScopes = (id , cb ) ->
193
+ cb ()
192
194
scope = scopes[0 ]
193
195
sinon .stub (AccessToken, ' verify' ).callsArgWith (2 , null , {})
194
196
sinon .stub (Role, ' get' ).callsArgWith (1 , null , role)
@@ -240,7 +242,7 @@ describe 'Role Scopes REST Routes', ->
240
242
res .headers [' content-type' ].should .contain ' text/html'
241
243
242
244
it ' should respond with "Not found" error' , ->
243
- res .text .should .equal ' Not found.'
245
+ res .text .should .contain ' Not found.'
244
246
245
247
246
248
describe ' with unknown scope' , ->
@@ -270,7 +272,7 @@ describe 'Role Scopes REST Routes', ->
270
272
res .headers [' content-type' ].should .contain ' text/html'
271
273
272
274
it ' should respond with "Not found" error' , ->
273
- res .text .should .equal ' Not found.'
275
+ res .text .should .contain ' Not found.'
274
276
275
277
276
278
@@ -294,7 +296,7 @@ describe 'Role Scopes REST Routes', ->
294
296
res .statusCode .should .equal 401
295
297
296
298
it ' should respond "Unauthorized"' , ->
297
- res .text .should .equal ' Unauthorized'
299
+ res .text .should .contain ' Unauthorized'
298
300
299
301
300
302
describe ' with unknown role' , ->
@@ -321,7 +323,7 @@ describe 'Role Scopes REST Routes', ->
321
323
res .headers [' content-type' ].should .contain ' text/html'
322
324
323
325
it ' should respond with "Not found" error' , ->
324
- res .text .should .equal ' Not found.'
326
+ res .text .should .contain ' Not found.'
325
327
326
328
327
329
describe ' with valid request' , ->
0 commit comments