(function() {
    module('BackboneBase.Request', {
        setup: function() {
            var requests = this.requests = [];
            this.Collection = Backbone.Collection.extend({url: 'https://api.github.com/repos/docyes/backbonebase/commits'});
            _.extend(this.Collection.prototype, BackboneBase.Request);
            this.xhr = sinon.useFakeXMLHttpRequest();  
            this.xhr.onCreate = function(xhr) {
                requests.push(xhr);
            };
        },
        
        teardown: function() {
            this.xhr.restore();
        }
    });

    test('enqueue', 4, function() {
        var collection = new this.Collection();
        collection.enqueueFetch({
            data: {req: 1},
        });
        collection.enqueueFetch({
            data: {req: 2}}
        );        
        equal(this.requests.length, 1, 'only one request other in queue');
        this.requests[0].respond(
            200, 
            {"Content-Type": "application/json" },
            '[{ "id": 1, "comment": "Hello world" }]'
        );
        equal(this.requests.length, 2, 'two requests as other completed');
        equal(collection.at(0).id, 1, 'collection first item has expected id');
        this.requests[1].respond(
            200, 
            {"Content-Type": "application/json" },
            '[{ "id": 2, "comment": "Hello world" }]'
        );
        equal(collection.at(0).id, 2, 'collection first item has expected id');
    });

})();


@@ -596,9 +596,9 @@
 e', 
-4
+6
 , fu
@@ -716,17 +716,16 @@
 %7Breq: 1%7D
-,
 %0A       
@@ -789,17 +789,16 @@
 %7Breq: 2%7D
-%7D
 %0A       
@@ -802,18 +802,84 @@
     
+%7D
 );
+%0A  
       
-  
+collection.enqueueFetch(%7B%0A            data: %7Breq: 3%7D%0A        %7D);
 %0A   
@@ -1517,24 +1517,328 @@
 ected id');%0A
+        equal(this.requests%5B0%5D.url, 'https://api.github.com/repos/docyes/backbonebase/commits?req=1', 'first request was from the first enqueue call');%0A        equal(this.requests%5B1%5D.url, 'https://api.github.com/repos/docyes/backbonebase/commits?req=3', 'second request was from the last enqueue call');%0A
     %7D);%0A%0A%7D)(

add more comprensive testing to enqueue