Skip to content

Commit

Permalink
tests(resource): add test for exists()
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Doshi committed Jul 13, 2015
1 parent feccc24 commit 3565af9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/unit/resource.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,20 @@ describe('eveResource', function() {

expect(angular.toJson(note)).toBe('{}');
}));

it('should check if the object resource is new or if it already exists in the database', inject(function(eveResource) {
var CreditCard = eveResource('/user/:userId/card/:cardId', {
userId:123,
cardId:'@id'
}, {
charge: {
method:'POST',
params:{
charge: true
}
}
}), creditCard = new CreditCard();

expect(creditCard.exists()).toEqual(false);
}));
});

0 comments on commit 3565af9

Please sign in to comment.