Guest User

Untitled

a guest
Jan 21st, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. it("should make a server request from passed options", function() {
  2. runs(function(){
  3. var options = { endPoint: '/json/admin/user',
  4. method: 'get_list',
  5. data: {},
  6. successCallback: function(res) {
  7. // can i put a spy here to make sure the callback is fired?
  8. console.log("SUCCESS")
  9. console.log(res)
  10. }
  11. };
  12. // Not using the spy correctly
  13. spyOn(options, 'successCallback');
  14. App.request(options);
  15. expect(options.successCallback).toHaveBeenCalled()
  16. })
  17. });
Add Comment
Please, Sign In to add comment