mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-02 12:14:45 +00:00
added additional test
This commit is contained in:
parent
49e08f5d2c
commit
4aac29da18
2 changed files with 8 additions and 1 deletions
|
|
@ -213,7 +213,7 @@ function switchRouteMatcher(on, when, dstName) {
|
||||||
return match ? dst : null;
|
return match ? dst : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
angularService('$route', function(location, params){
|
angularService('$route', function(location){
|
||||||
var routes = {},
|
var routes = {},
|
||||||
onChange = [],
|
onChange = [],
|
||||||
matcher = switchRouteMatcher,
|
matcher = switchRouteMatcher,
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,13 @@ describe("resource", function() {
|
||||||
CreditCard.charge({id:123, amount:10},{auth:'abc'}, callback);
|
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(){
|
it('should create on save', function(){
|
||||||
xhr.expectPOST('/CreditCard', {name:'misko'}).respond({id:123});
|
xhr.expectPOST('/CreditCard', {name:'misko'}).respond({id:123});
|
||||||
var cc = new CreditCard();
|
var cc = new CreditCard();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue