Skip to content

Commit 320c385

Browse files
committed
Bump version
1 parent 66d507b commit 320c385

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
"summary": "Server Side Router for Meteor",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"git": "https://github.com/meteorhacks/picker.git",
55
"name": "meteorhacks:picker"
66
});

test/instance.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Tinytest.add('middlewares', function(test) {
5555
next();
5656
}, 500);
5757
});
58-
58+
5959
Picker.route(path, function(params, req, res) {
6060
res.end(req.middlewarePass);
6161
});
@@ -64,6 +64,29 @@ Tinytest.add('middlewares', function(test) {
6464
test.equal(res.content, "ok");
6565
});
6666

67+
Tinytest.add('middlewares - with filtered routes', function(test) {
68+
var path = "/" + Random.id() + "/coola";
69+
70+
var routes = Picker.filter(function(req, res) {
71+
var matched = /coola/.test(req.url);
72+
return matched;
73+
});
74+
75+
routes.middleware(function(req, res, next) {
76+
setTimeout(function() {
77+
req.middlewarePass = "ok";
78+
next();
79+
}, 500);
80+
});
81+
82+
routes.route(path, function(params, req, res) {
83+
res.end(req.middlewarePass);
84+
});
85+
86+
var res = HTTP.get(getPath(path));
87+
test.equal(res.content, "ok");
88+
});
89+
6790
var urlResolve = Npm.require('url').resolve;
6891
function getPath(path) {
6992
return urlResolve(process.env.ROOT_URL, path);

0 commit comments

Comments
 (0)