I want to check if a specific header is present in the request. This is an article that helped me crack the headlines.
http://jbavari.imtqy.com/blog/2014/06/20/testing-interceptor-headers-in-angularjs/
Below is a snippet from my test. This gives me access to the headers, but the problem is that (it will), it is expected that the headers will be executed when I clear the requests, which does not give my test implicitly.
$httpBackend .expect('POST', 'https://www.someurl.com/login', userObj, function (headers) { expect(headers['content-type']).toBe('application/x-www-form-urlencoded'); }) .respond();
Any suggestions?
source share