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

Commit e1850dc

Browse files
committed
tighter status constraints
1 parent 22aefea commit e1850dc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/helpers.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,18 @@ _it.shouldBeAllowed = function() {
211211
it('should be allowed', function() {
212212
assert(this.req);
213213
assert(this.res);
214-
//if not in list
215-
assert([404,403,401].indexOf(this.res.statusCode) == -1);
214+
//status 200 -> 399
215+
var status = this.res.statusCode;
216+
assert(status >= 200 && status <= 399);
216217
});
217218
}
218219

219220
_it.shouldBeDenied = function() {
220221
it('should not be allowed', function() {
221222
assert(this.res);
222223
//if in list
223-
assert([404,403,401].indexOf(this.res.statusCode) > -1);
224+
var status = this.res.statusCode;
225+
assert([403,401].indexOf(this.res.statusCode) > -1);
224226
});
225227
}
226228

0 commit comments

Comments
 (0)