adds test for a non-existing cookie read

this tests the functionality added in #15
This commit is contained in:
Sean McArthur 2012-08-16 13:40:52 -07:00
Родитель 715e97f81f
Коммит c4f4fda169
1 изменённых файлов: 21 добавлений и 1 удалений

Просмотреть файл

@ -189,7 +189,7 @@ suite.addBatch({
});
suite.addBatch({
"reading from a session" : {
"reading from an existing session" : {
topic: function() {
var self = this;
@ -216,6 +216,26 @@ suite.addBatch({
"does not set a cookie": function(err, res) {
assert.isUndefined(res.headers['set-cookie']);
}
},
"reading from a non-existing session" : {
topic: function() {
var self = this;
// simple app
var app = create_app();
app.get("/foo", function(req, res) {
res.send(req.session.foo);
});
var browser = tobi.createBrowser(app);
browser.get("/foo", function(res, $) {
self.callback(null, res);
});
},
"does not set a cookie": function(err, res) {
assert.isUndefined(res.headers['set-cookie']);
}
}
});