Permalink
Browse files

test that the fix for the route when not passing a verb works

  • Loading branch information...
1 parent 904f9d5 commit 81615fe3e286ee095b894fe44e431be3bc8fc6cc @endor endor committed Feb 9, 2014
Showing with 13 additions and 0 deletions.
  1. +13 −0 test/application_spec.js
View
@@ -147,6 +147,19 @@ describe('Application', function() {
expect(route.path.toString()).to.eql(new RegExp("#/$").toString());
});
+ it('assumes the verb is any if only path and callback are passed as parameters', function() {
+ app.route('/blah', function() {
+ $('#testarea').show();
+ });
+
+ var route = app.routes['get'][1];
+ expect(route.callback[0]).to.be.a(Function);
+ expect(route.path.toString()).to.eql(new RegExp("/blah$").toString());
+ route = app.routes['post'][0];
+ expect(route.callback[0]).to.be.a(Function);
+ expect(route.path.toString()).to.eql(new RegExp("/blah$").toString());
+ });
+
it('looks up the callback as a string', function() {
app.mycallback = function() { this.redirect('#/'); };
app.post('#/post', 'mycallback');

0 comments on commit 81615fe

Please sign in to comment.