diff options
author | Phil Hughes <me@iamphill.com> | 2018-01-31 10:14:55 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-01-31 10:14:55 +0000 |
commit | 641f1d2c4b210026fd40c4c3d3acc1bd41dc9adc (patch) | |
tree | a8f1be947c139f6ed16e7e52b4e9d01db7845b5d /spec/javascripts | |
parent | ae401d03d3261cda379ccd3367a877fb095c4e59 (diff) | |
download | gitlab-ce-641f1d2c4b210026fd40c4c3d3acc1bd41dc9adc.tar.gz |
Converted common_utils to axios
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/lib/utils/common_utils_spec.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js b/spec/javascripts/lib/utils/common_utils_spec.js index 0a9d815f469..bb71c181b3d 100644 --- a/spec/javascripts/lib/utils/common_utils_spec.js +++ b/spec/javascripts/lib/utils/common_utils_spec.js @@ -1,5 +1,5 @@ /* eslint-disable promise/catch-or-return */ - +import axios from '~/lib/utils/axios_utils'; import * as commonUtils from '~/lib/utils/common_utils'; describe('common_utils', () => { @@ -451,10 +451,12 @@ describe('common_utils', () => { it('should perform `$.ajax` call and do `POST` request', () => { const requestURL = '/some/random/api'; const data = { keyname: 'value' }; - const ajaxSpy = spyOn($, 'ajax').and.callFake(() => {}); + const ajaxSpy = spyOn(axios, 'post').and.callFake(() => {}); commonUtils.ajaxPost(requestURL, data); - expect(ajaxSpy.calls.allArgs()[0][0].type).toEqual('POST'); + + expect(ajaxSpy.calls.allArgs()[0][0]).toEqual(requestURL); + expect(ajaxSpy.calls.allArgs()[0][1]).toEqual(data); }); }); |