fix ($http): throw error when string URL is provided

This commit is contained in:
Dustin
2014-11-22 12:07:19 -08:00
committed by Chirayu Krishnappa
parent 7a374691b9
commit e9b9421cdb
3 changed files with 20 additions and 0 deletions

View File

@@ -285,6 +285,12 @@ describe('$http', function() {
$http = $h;
}]));
it('should throw error if the request configuration is not an object', inject(function($httpBackend, $http) {
expect(function() {
$http('/url');
}).toThrowMinErr('$http','badreq', 'Http request configuration must be an object. Received: /url');
}));
it('should send GET requests if no method specified', inject(function($httpBackend, $http) {
$httpBackend.expect('GET', '/url').respond('');
$http({url: '/url'});