Skip to content

Commit dfd3208

Browse files
author
Thom Seddon
committed
Explitly set JSON spaces to ensure regex matches with different ENV
1 parent 9baf378 commit dfd3208

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/grant.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var bootstrap = function (oauthConfig) {
2727
grants: ['password', 'refresh_token']
2828
});
2929

30+
app.set('json spaces', 0);
3031
app.use(express.bodyParser());
3132

3233
app.all('/oauth/token', oauth.grant());
@@ -394,7 +395,7 @@ describe('Grant', function() {
394395
client_secret: 'nightworld',
395396
refresh_token: 'abc123'
396397
})
397-
.expect(200, /"access_token": "(.*)",\n\s+(.*)\n\s+"refresh_token": "(.*)"/i, done);
398+
.expect(200, /"access_token":"(.*)",(.*)"refresh_token":"(.*)"/i, done);
398399

399400
});
400401

@@ -436,7 +437,7 @@ describe('Grant', function() {
436437
client_secret: 'nightworld',
437438
refresh_token: 'abc123'
438439
})
439-
.expect(200, /"access_token": "(.*)",\n\s+(.*)\n\s+"refresh_token": "(.*)"/i, done);
440+
.expect(200, /"access_token":"(.*)",(.*)"refresh_token":"(.*)"/i, done);
440441

441442
});
442443
});
@@ -630,7 +631,7 @@ describe('Grant', function() {
630631
.post('/oauth/token')
631632
.set('Content-Type', 'application/x-www-form-urlencoded')
632633
.send(validBody)
633-
.expect(/"access_token": "thommy"/, 200, done);
634+
.expect(/"access_token":"thommy"/, 200, done);
634635

635636
});
636637
});

0 commit comments

Comments
 (0)