aboutsummaryrefslogtreecommitdiffstats
path: root/test/ResourceSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ResourceSpec.js')
-rw-r--r--test/ResourceSpec.js58
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;