adds test for a non-existing cookie read
this tests the functionality added in #15
This commit is contained in:
Родитель
715e97f81f
Коммит
c4f4fda169
|
@ -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']);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче