Commit 0d0c819a authored by Thomas Lechauve's avatar Thomas Lechauve

Adapt unit tests to the new library

parent 772b9400
...@@ -82,11 +82,10 @@ ...@@ -82,11 +82,10 @@
datatype: 'json', datatype: 'json',
context: $(this), context: $(this),
beforeSend: function (xhr) { beforeSend: function (xhr) {
xhr.setRequestHeader('REMOTE_USER', 'test_vifib_customer'); //xhr.setRequestHeader('REMOTE_USER', 'test_vifib_customer');
xhr.setRequestHeader('Accept', 'application/json'); xhr.setRequestHeader('Accept', 'application/json');
if ($(this).slapos('access_token') && authentication) { if ($(this).slapos('access_token') && authentication) {
//xhr.setRequestHeader('Authorization', $(this).slapos('store', 'token_type') + ' ' + $(this).slapos('access_token')); xhr.setRequestHeader('Authorization', $(this).slapos('store', 'token_type') + ' ' + $(this).slapos('access_token'));
//xhr.setRequestHeader('Accept', 'application/json');
} }
} }
}; };
...@@ -120,7 +119,7 @@ ...@@ -120,7 +119,7 @@
beforeSend: function (xhr) { beforeSend: function (xhr) {
xhr.setRequestHeader('Accept', 'application/json'); xhr.setRequestHeader('Accept', 'application/json');
}, },
success: callback success: callback,
}); });
}); });
}, },
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<!-- Load local SinonJs --> <!-- Load local SinonJs -->
<script type="text/javascript" src="../libs/sinon/sinon-1.3.2.js"></script> <script type="text/javascript" src="../libs/sinon/sinon-1.3.2.js"></script>
<script type="text/javascript" src="../libs/sinon/sinon-qunit-1.0.0.js"></script> <script type="text/javascript" src="../libs/sinon/sinon-qunit-1.0.0.js"></script>
<script type="text/javascript" src="../libs/sinon/sinon-server-1.3.2.js"></script> <!--<script type="text/javascript" src="../libs/sinon/sinon-server-1.3.2.js"></script>-->
<!-- Load local lib and tests. --> <!-- Load local lib and tests. -->
<script src="../src/jquery.slapos.js"></script> <script src="../src/jquery.slapos.js"></script>
<script src="jquery.slapos_test.js"></script> <script src="jquery.slapos_test.js"></script>
......
This diff is collapsed.
...@@ -82,11 +82,10 @@ ...@@ -82,11 +82,10 @@
datatype: 'json', datatype: 'json',
context: $(this), context: $(this),
beforeSend: function (xhr) { beforeSend: function (xhr) {
xhr.setRequestHeader('REMOTE_USER', 'test_vifib_customer'); //xhr.setRequestHeader('REMOTE_USER', 'test_vifib_customer');
xhr.setRequestHeader('Accept', 'application/json'); xhr.setRequestHeader('Accept', 'application/json');
if ($(this).slapos('access_token') && authentication) { if ($(this).slapos('access_token') && authentication) {
//xhr.setRequestHeader('Authorization', $(this).slapos('store', 'token_type') + ' ' + $(this).slapos('access_token')); xhr.setRequestHeader('Authorization', $(this).slapos('store', 'token_type') + ' ' + $(this).slapos('access_token'));
//xhr.setRequestHeader('Accept', 'application/json');
} }
} }
}; };
...@@ -120,7 +119,7 @@ ...@@ -120,7 +119,7 @@
beforeSend: function (xhr) { beforeSend: function (xhr) {
xhr.setRequestHeader('Accept', 'application/json'); xhr.setRequestHeader('Accept', 'application/json');
}, },
success: callback success: callback,
}); });
}); });
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment