aboutsummaryrefslogtreecommitdiffstats
path: root/test/ResourceSpec.js
diff options
context:
space:
mode:
authorAdam Abrons2010-03-16 14:48:11 -0700
committerAdam Abrons2010-03-16 14:48:11 -0700
commitc9aba8b442adce496f0600c88764f7ffcc166879 (patch)
tree5f787dc4eec0f892ed939cdfa1c6b5d5e8033443 /test/ResourceSpec.js
parent2df072e3f89e8998b06b5a9e5ffb10fa32155136 (diff)
downloadangular.js-c9aba8b442adce496f0600c88764f7ffcc166879.tar.bz2
make xhr just a method
Diffstat (limited to 'test/ResourceSpec.js')
-rw-r--r--test/ResourceSpec.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js
index 799c7378..0c7af00a 100644
--- a/test/ResourceSpec.js
+++ b/test/ResourceSpec.js
@@ -61,7 +61,7 @@ describe("resource", function() {
beforeEach(function(){
xhr = new MockXHR();
- resource = new ResourceFactory(xhr);
+ resource = new ResourceFactory(_(xhr.method).bind(xhr));
CreditCard = resource.route('/CreditCard/:id:verb', {id:'@id.key'}, {
charge:{
method:'POST',
@@ -80,6 +80,11 @@ describe("resource", function() {
expect(typeof CreditCard.query).toBe('function');
});
+ it('should default to empty parameters', function(){
+ xhr.expectGET('URL').respond({});
+ resource.route('URL').query();
+ });
+
it("should build resource with default param", function(){
xhr.expectGET('/Order/123/Line/456.visa?minimum=0.05').respond({id:'abc'});
var LineItem = resource.route('/Order/:orderId/Line/:id:verb', {orderId: '123', id: '@id.key', verb:'.visa', minimum:0.05});