From c9aba8b442adce496f0600c88764f7ffcc166879 Mon Sep 17 00:00:00 2001 From: Adam Abrons Date: Tue, 16 Mar 2010 14:48:11 -0700 Subject: make xhr just a method --- test/ResourceSpec.js | 7 ++++++- test/scenario/StepsTest.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'test') 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}); diff --git a/test/scenario/StepsTest.js b/test/scenario/StepsTest.js index 9d64d0a9..32ef637d 100644 --- a/test/scenario/StepsTest.js +++ b/test/scenario/StepsTest.js @@ -2,6 +2,6 @@ StepsTest = TestCase("StepsTest"); StepsTest.prototype.testGivenDataset=function(){ var self = {frame:{}, dataset:[]}; - angular.test.GIVEN.dataset.call(self); + angular.scenario.GIVEN.dataset.call(self); assertEquals('$DATASET:{"dataset":[]}', self.frame.name); }; -- cgit v1.2.3