var xhr = sinon.useFakeXMLHttpRequest();
var API_URL = 'https://api.dribbble.com/v1';

// We don't need a real token here because we won't be making requests to the API
$.jribbble.setToken('1234');

test('jribbble.shots', function(assert) {
  var url = API_URL + '/shots';

  var shots = function(args) {
    var shots = $.jribbble.shots(args);
    console.log(args.per_page);
    console.log(shots.url);
    return shots;
  };

  // assert.equal(
  //   shots().url, url,
  //   'shots() with no arguments.'
  // );

  assert.equal(
    shots({'per_page': 5, 'page': 2}).url, url + '?per_page=5&page=2',
    'shots() with per_page and page params.'
  );
  //
  // assert.equal(
  //   $.jribbble.shots('animated').url,
  //   url + '?list=animated',
  //   'shots() with a list name.'
  // );
  //
  // assert.equal(
  //   $.jribbble.shots('1234').url,
  //   url + '/1234',
  //   'shots() with a shot ID.'
  // );
  //
  // assert.equal(
  //   $.jribbble.shots('1234', {'per_page': 3}).url,
  //   url + '/1234?per_page=3',
  //   'shots() with a shot ID and per_page param.'
  // );
});

// test('jribbble.shots.attachments urls', function(assert) {
//   var url = API_URL + '/shots/1234';
//
//   assert.equal(
//     $.jribbble.shots('1234').attachments().url,
//     url + '/attachments',
//     'All attachments() for the shot 1234.'
//   );
// });

@@ -192,16 +192,276 @@
 234');%0A%0A
+// Since we don't want to test Promises and we don't want to test the Dribbble API,%0A// we want to focus on the URLS that Jribbble creates. Each of theses tests makes%0A// a call to shots() passing it different valid inputs that should produce valid%0A// API URLs.%0A
 test('jr
@@ -472,16 +472,21 @@
 le.shots
+ urls
 ', funct
@@ -530,16 +530,45 @@
 /shots';
+%0A  var done = assert.async();
 %0A%0A  var 
@@ -640,92 +640,357 @@
     
-console.log(args.per_page);%0A    console.log(shots.url);%0A    return shots;%0A  %7D;%0A%0A  //
+return shots;%0A  %7D;%0A%0A  var shotsWithoutArgs = shots();%0A  var shotsWithParams = shots(%7B%0A    'per_page': 5,%0A    'page': 2,%0A    'sort': 'views',%0A    'timeframe': 'month'%0A  %7D);%0A  var shotsWithListName = shots('animated');%0A  var shotsWithID = shots('1234');%0A%0A  // jribbble.shots is an async queue so we need to wait a moment.%0A  setTimeout(function() %7B%0A   
  ass
@@ -1006,18 +1006,17 @@
 (%0A  
-//
+ 
    shots
 ().u
@@ -1015,23 +1015,38 @@
 hots
-().url,
+WithoutArgs.url,%0A     
  url,%0A  
 //  
@@ -1037,26 +1037,25 @@
      url,%0A  
-//
+ 
    'shots() 
@@ -1075,20 +1075,45 @@
 ents
-.'%0A  //
+: ' + shotsWithoutArgs.url%0A   
  );%0A%0A
+  
   as
@@ -1132,75 +1132,94 @@
     
+  
 shots
-(%7B'per_page': 5, 'page': 2%7D).url, url + '?per_page=5&page=2
+WithParams.url,%0A      url + '?per_page=5&page=2&sort=views&timeframe=month
 ',%0A
+  
     
@@ -1260,25 +1260,45 @@
 rams
-.'%0A
+: ' + shotsWithParams.url%0A 
   
+ 
 );%0A
-  //
 %0A  
-//
+ 
  ass
@@ -1314,49 +1314,37 @@
 (%0A  
-//
    
-$.jribbble.shots('animated')
+ shotsWithListName
 .url,%0A  
 //  
@@ -1335,29 +1335,28 @@
 Name.url,%0A  
-//
    
+ 
 url + '?list
@@ -1365,29 +1365,28 @@
 nimated',%0A  
-//
    
+ 
 'shots() wit
@@ -1398,36 +1398,55 @@
 ist name
-.'%0A  //
+: ' + shotsWithListName.url%0A   
  );%0A
+%0A 
   
-//%0A  //
  assert.
@@ -1458,45 +1458,31 @@
 (%0A  
-//   $.jribbble.shots('1234')
+    shotsWithID
 .url,%0A  
 //  
@@ -1469,37 +1469,36 @@
 tsWithID.url,%0A  
-//
    
+ 
 url + '/1234',%0A 
@@ -1494,26 +1494,25 @@
  '/1234',%0A  
-//
+ 
    'shots() 
@@ -1529,187 +1529,53 @@
 t ID
-.'%0A  // );%0A  //%0A  // assert.equal(%0A  //   $.jribbble.shots('1234', %7B'per_page': 3%7D)
+: ' + shotsWithID
 .url
-,
 %0A  
-//   url + '/1234?per_page=3',%0A  //   'shots() with a shot ID and per_page param.'%0A  // 
+  );%0A%0A    done();%0A  %7D
 );%0A%7D

Update tests for async