mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 11:37:38 +08:00
fix ($http): throw error when string URL is provided
This commit is contained in:
committed by
Chirayu Krishnappa
parent
7a374691b9
commit
e9b9421cdb
@@ -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'});
|
||||
|
||||
Reference in New Issue
Block a user