aboutsummaryrefslogtreecommitdiffstats
path: root/test/ResourceSpec.js
diff options
context:
space:
mode:
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});