Commit 8fae249e authored by Thomas Lechauve's avatar Thomas Lechauve

Fix search method: remove clean list call

parent 2bb1d0e5
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
hash[extracted.keys[k]] = result[k]; hash[extracted.keys[k]] = result[k];
} }
this.current = this.list[i][j]; this.current = this.list[i][j];
this.clean(i + 1);
this.list[i][j].callback(hash); this.list[i][j].callback(hash);
} }
j += 1; j += 1;
......
...@@ -47,6 +47,7 @@ $(function () { ...@@ -47,6 +47,7 @@ $(function () {
url2 = {'route': '#/new/path/1', 'param1': 'foo1'}, url2 = {'route': '#/new/path/1', 'param1': 'foo1'},
url3 = {'route': '#/new/path/1/foo', 'param1': 'foo1'}, url3 = {'route': '#/new/path/1/foo', 'param1': 'foo1'},
spy = sinon.spy(); spy = sinon.spy();
$.router.routes.add('#/new/path', 0, spy); $.router.routes.add('#/new/path', 0, spy);
$.router.routes.add('#/new/path/:id', 1, spy); $.router.routes.add('#/new/path/:id', 1, spy);
$.router.routes.add('#/new/path/:id/:other', 2, spy); $.router.routes.add('#/new/path/:id/:other', 2, spy);
...@@ -57,10 +58,12 @@ $(function () { ...@@ -57,10 +58,12 @@ $(function () {
$.router.routes.search(url2); $.router.routes.search(url2);
delete url2.route; delete url2.route;
$.extend(url2, {'id': '1'});
ok(spy.calledWith(url2)); ok(spy.calledWith(url2));
$.router.routes.search(url3); $.router.routes.search(url3);
delete url3.route; delete url3.route;
$.extend(url3, {'id': '1', 'other': 'foo'});
ok(spy.calledWith(url3)); ok(spy.calledWith(url3));
ok(spy.calledThrice); ok(spy.calledThrice);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment