Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 12d3bad

Browse files
committed
Merge pull request #12 from karlmikko/master
extend range of status allowed/denied
2 parents 13fcdfc + edee7c1 commit 12d3bad

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/helpers.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,18 @@ _it.shouldBeAllowed = function() {
211211
it('should be allowed', function() {
212212
assert(this.req);
213213
assert(this.res);
214-
assert.notEqual(this.res.statusCode, 401);
214+
//status 200 -> 399
215+
var status = this.res.statusCode;
216+
assert(status >= 200 && status <= 399);
215217
});
216218
}
217219

218220
_it.shouldBeDenied = function() {
219221
it('should not be allowed', function() {
220222
assert(this.res);
223+
//if in list
221224
var status = this.res.statusCode;
222-
assert(status === 401 || status === 404);
225+
assert([403,401].indexOf(status) > -1);
223226
});
224227
}
225228

0 commit comments

Comments
 (0)