diff options
| author | Misko Hevery | 2010-08-10 11:17:08 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-08-10 11:17:08 -0700 |
| commit | 4aac29da18ea4680a928edccc28dd8edad93e593 (patch) | |
| tree | a24d013a3a39b69a8b005b8f51590ac2fc3c6327 | |
| parent | 49e08f5d2c328d095b5a53413474307001240ac8 (diff) | |
| download | angular.js-4aac29da18ea4680a928edccc28dd8edad93e593.tar.bz2 | |
added additional test
| -rw-r--r-- | src/services.js | 2 | ||||
| -rw-r--r-- | test/ResourceSpec.js | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/services.js b/src/services.js index 8df23564..fa9cdaa4 100644 --- a/src/services.js +++ b/src/services.js @@ -213,7 +213,7 @@ function switchRouteMatcher(on, when, dstName) { return match ? dst : null; } -angularService('$route', function(location, params){ +angularService('$route', function(location){ var routes = {}, onChange = [], matcher = switchRouteMatcher, diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js index 6e32ce18..546e9aec 100644 --- a/test/ResourceSpec.js +++ b/test/ResourceSpec.js @@ -114,6 +114,13 @@ describe("resource", function() { CreditCard.charge({id:123, amount:10},{auth:'abc'}, callback); }); + it('should post charge verb on instance', function(){ + xhr.expectPOST('/CreditCard/123!charge?amount=10', {id:{key:123}, name:'misko'}).respond({success:'ok'}); + + var card = new CreditCard({id:{key:123}, name:'misko'}); + card.$charge({amount:10}, callback); + }); + it('should create on save', function(){ xhr.expectPOST('/CreditCard', {name:'misko'}).respond({id:123}); var cc = new CreditCard(); |
