|
|
|
@ -135,4 +135,30 @@ test("auth_token with several params as array param and present in url", functio
|
|
|
|
|
ok(lastCall.indexOf("auth_token[]=token2") !== -1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
{ shouldInvokeFetchMap: true, desc: 'undefined no_fetch_map option provided should invoke _fetchMap' },
|
|
|
|
|
{ no_fetch_map: false, shouldInvokeFetchMap: true, desc: 'no_fetch_map=false should invoke _fetchMap' },
|
|
|
|
|
{ no_fetch_map: true, shouldInvokeFetchMap: false, desc: 'no_fetch_map=true should NOT invoke _fetchMap' }
|
|
|
|
|
].forEach(function(fetchMapCase) {
|
|
|
|
|
|
|
|
|
|
test("no_fetch_map option: " + fetchMapCase.desc, function() {
|
|
|
|
|
var fetchMapFn = torque.providers.windshaft.prototype._fetchMap;
|
|
|
|
|
|
|
|
|
|
var _fetchMapInvoked = false;
|
|
|
|
|
torque.providers.windshaft.prototype._fetchMap = function() {
|
|
|
|
|
_fetchMapInvoked = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
new torque.providers.windshaft({
|
|
|
|
|
table: 'test',
|
|
|
|
|
user: "rambo",
|
|
|
|
|
no_fetch_map: fetchMapCase.no_fetch_map
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
equal(_fetchMapInvoked, fetchMapCase.shouldInvokeFetchMap);
|
|
|
|
|
|
|
|
|
|
torque.providers.windshaft.prototype._fetchMap = fetchMapFn;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|