1
0
Fork 0

implement tests checking that writing to the hideen agency stuff is

forbidden
This commit is contained in:
Andreas Streichardt 2016-09-07 14:03:22 +02:00
parent 43125c2a10
commit e2782a7376
1 changed files with 15 additions and 1 deletions

View File

@ -612,8 +612,22 @@ function agencyTestSuite () {
var res = writeAgency([[{"/bumms":{"op":"set","new":"fallera"}, "/bummsfallera": {"op":"set","new":"lalalala"}}]]);
assertEqual(res.statusCode, 200);
assertEqual(readAndCheck([["/bumms", "/bummsfallera"]]), [{bumms:"fallera", bummsfallera: "lalalala"}]);
}
},
testHiddenAgencyWrite: {
var res = writeAgency([[{".agency": {"op":"set","new":"fallera"}}]]);
assertEqual(res.statusCode, 400);
},
testHiddenAgencyWriteSlash: {
var res = writeAgency([[{"/.agency": {"op":"set","new":"fallera"}}]]);
assertEqual(res.statusCode, 400);
},
testHiddenAgencyWriteDeep: {
var res = writeAgency([[{"/.agency/hans": {"op":"set","new":"fallera"}}]]);
assertEqual(res.statusCode, 400);
}
};
}