-
-
Save allensb/141858106aad6655adae 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
it("should make an ajax call to api/students", function () { | |
httpBackend.expectGET('app/views/home/home.html').respond(200); | |
httpBackend.whenGET("http://localhost:7000/api/student/1").respond(200, { | |
id: 7, // Data returned, but not set in scope | |
first: 'Chris', | |
last: 'Johnson' | |
}); | |
controller("UpdateCtrl", {$scope: scope, studentApi: service, $routeParams: {id: 1}}); | |
httpBackend.flush(); | |
expect(scope.first).toBe('Chris'); | |
expect(scope.last).toBe('Johnson'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment