Last active
August 29, 2015 13:56
-
-
Save ansmith/8959855 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("MyService", function() { | |
'use strict'; | |
var service; | |
beforeEach(module('myApp')); | |
beforeEach(inject(function($templateCache) { | |
//Whatever the default route is, needs to be cached so $httpBackend doesn't see other requests | |
$templateCache.put('views/default.html', __html__['src/main/webapp/views/default.html']); | |
})); | |
it('makes a request', inject(function(MyService, $httpBackend) { | |
spyOn(MyService, 'getState').andReturn({ | |
method: 'GET', | |
url: '/services/MyService', | |
data: { | |
key1: 'value1' | |
} | |
}); | |
$httpBackend.expectGET('/services/MyService?key1=value1').respond(); | |
MyService.save('key1'); | |
$httpBackend.flush(); | |
})); | |
}); |
Haha... yea, I cut and pasted that from somewhere. Should've thought about it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
'use strict' should belong to a function