Redirection fixes (#8592)

* fix(redirects): logic update

* test(middlewares): redirects tests

* fix(nconf): IS_PROD is boolean

* fix(test): treat IS_PROD as Boolean here too

* fix(test): apiUrl test copypasta
This commit is contained in:
Sabe Jones
2017-03-23 10:25:58 -05:00
committed by GitHub
parent 59f490d178
commit 77ff91868e
3 changed files with 193 additions and 14 deletions

View File

@@ -30,16 +30,17 @@ export function generateChallenge (options = {}) {
export function generateRes (options = {}) {
let defaultRes = {
render: sandbox.stub(),
send: sandbox.stub(),
status: sandbox.stub().returnsThis(),
sendStatus: sandbox.stub().returnsThis(),
json: sandbox.stub(),
locals: {
user: generateUser(options.localsUser),
group: generateGroup(options.localsGroup),
},
redirect: sandbox.stub(),
render: sandbox.stub(),
send: sandbox.stub(),
sendStatus: sandbox.stub().returnsThis(),
set: sandbox.stub(),
status: sandbox.stub().returnsThis(),
t (string) {
return i18n.t(string);
},