diff options
| author | Misko Hevery | 2010-04-29 10:55:22 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2010-04-29 10:55:22 -0700 | 
| commit | 913729ee0120cc72e13b18d826c6da0fe2b98bf7 (patch) | |
| tree | 678be5150690cec530058a3f8e399f4a30e632e1 /test/ResourceSpec.js | |
| parent | fce48eb60a47be87a3d95e0750e54c19c2a346d0 (diff) | |
| download | angular.js-913729ee0120cc72e13b18d826c6da0fe2b98bf7.tar.bz2 | |
fix isssue where the jasmine currentSpec does not get updated and hence everything runs as last spec context.
Diffstat (limited to 'test/ResourceSpec.js')
| -rw-r--r-- | test/ResourceSpec.js | 58 | 
1 files changed, 0 insertions, 58 deletions
diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js index 08ca86b3..f2a0ff41 100644 --- a/test/ResourceSpec.js +++ b/test/ResourceSpec.js @@ -1,61 +1,3 @@ -function MockXHR(){ -  this.expectations = { -    'GET': {}, -    'POST': {}, -    'DELETE': {} -  }; -  this.queue = []; -} -MockXHR.prototype = { -  method: function(verb, url, data, callback) { -    if (verb == 'POST') -      url += '|' + angular.toJson(data); -    var response = this.expectations[verb][url]; -    if (!response) -      throw "No expectation for " + verb + " on '" + url + "'."; -    this.queue.push(function(){ -      callback(response); -    }); -  }, - -  expectGET: function(url) { -    var self = this; -    return { -      respond: function(response){ -        self.expectations.GET[url] = response; -      } -    }; -  }, - -  expectDELETE: function(url) { -    var self = this; -    return { -      respond: function(response){ -        self.expectations.DELETE[url] = response; -      } -    }; -  }, - -  expectPOST: function(url) { -    var self = this; -    return { -      data: function(data){ -        return { -          respond: function(response){ -            self.expectations.POST[url + '|' + angular.toJson(data)] = response; -          } -        }; -      } -    }; -  }, - -  flush: function(){ -    while(this.queue.length) { -      this.queue.shift()(); -    } -  } -}; -  describe("resource", function() {    var xhr, resource, CreditCard, callback;  | 
