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