Created
December 19, 2019 13:45
-
-
Save lfreneda/d029bfd90ba4a16f22758c8befbc44f7 to your computer and use it in GitHub Desktop.
mocking_http_angularjs
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('HTTP GET', function () { | |
it("get github username", function () { | |
var response; | |
$httpBackend.when('GET', 'https://api.github.com/users/marciofmjr') | |
.respond(200, {worked: true}); | |
ContaAzulHelper.github().then(function(data) { | |
response = data; | |
}); | |
$httpBackend.flush(); | |
expect(response.data.worked).toEqual(true); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment