blob: 443034d09e627c54baf66905befe5adc0092ba5e [file] [log] [blame]
Matteo Scandolo57483dd2015-11-05 11:58:53 +01001'use strict';
Matteo Scandoloba4c9aa2016-02-11 09:35:29 -08002describe('The xos.helper module', function(){
Matteo Scandolo8420f622016-03-24 11:38:50 -07003 var SetCSRFToken, httpProviderObj;
Matteo Scandolo57483dd2015-11-05 11:58:53 +01004
Matteo Scandolo061094b2016-03-24 14:07:49 -07005 //beforeEach(module('xos.helpers'));
6 //
7 //beforeEach(inject(function($httpProvider){
8 // httpProviderObj = $httpProvider;
9 //}));
10 //
11 //beforeEach(inject(function(_SetCSRFToken_){
12 // console.log('inject csrf');
13 // SetCSRFToken = _SetCSRFToken_;
14 //}));
Matteo Scandoloba4c9aa2016-02-11 09:35:29 -080015
Matteo Scandolo061094b2016-03-24 14:07:49 -070016 beforeEach(function() {
17 module('xos.helpers', function ($httpProvider) {
18 //save our interceptor
19 httpProviderObj = $httpProvider;
20 });
Matteo Scandolo57483dd2015-11-05 11:58:53 +010021
Matteo Scandolo061094b2016-03-24 14:07:49 -070022 inject(function (_SetCSRFToken_) {
23 SetCSRFToken = _SetCSRFToken_;
24 })
25 });
Matteo Scandolo8420f622016-03-24 11:38:50 -070026
27 it('should exist', () => {
28 expect(SetCSRFToken).toBeDefined();
29 });
30
Matteo Scandolo061094b2016-03-24 14:07:49 -070031 it('should set SetCSRFToken interceptor', () => {
Matteo Scandolo8420f622016-03-24 11:38:50 -070032 expect(httpProviderObj).toBeDefined();
33 expect(httpProviderObj.interceptors).toContain('SetCSRFToken');
34 });
35
Matteo Scandolo57483dd2015-11-05 11:58:53 +010036});