diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-10-23 10:32:14 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-10-23 10:32:14 +0300 |
commit | 519ffa1ebf6eff8c7fee1e7aa919b44c1acfeb36 (patch) | |
tree | e2a96f675fbf8fed86568b64723b856ebd5012d9 /spec/javascripts/groups/service/groups_service_spec.js | |
parent | 1e78c627d4c6630df3bbfd4e905018314d692b6d (diff) | |
parent | 5d74973d8148548f505478ed773795d377e6f0d6 (diff) | |
download | gitlab-ce-519ffa1ebf6eff8c7fee1e7aa919b44c1acfeb36.tar.gz |
Merge branch 'master' into sh-headless-chrome-support
* master: (297 commits)
Fix deletion of container registry or images returning an error
The fog-aliyun gem had a bug in v0.1.0 for file storage creation/update. This merge requests update the gem to v0.2.0 which contains the fix:
Decrease ABC threshold to 54.28
Update VERSION to 10.2.0-pre
Update CHANGELOG.md for 10.1.0
Document `CI_SHARED_ENVIRONMENT` and `CI_DISPOSABLE_ENVIRONMENT`
Fix the external URLs generated for online view of HTML artifacts
Use title as placeholder instead of issue title for reusability
Fix failure in current_settings_spec.rb
Clarify the difference between project_update and project_rename
URI decode Page-Title header to preserve UTF-8 characters
Update Gitaly version to v0.49.0
Decrease Perceived Complexity threshold to 14
Resolve "Remove help text regarding group issues on group issues page (and group merge requests page)"
Force non diff resolved discussion to display when collapse toggled
Added submodule support in multi-file editor
add note about after_script being run separately
Check for element before evaluate_script
Merge branch 'master-i18n' into 'master'
Update Prometheus gem to fix problems with other files overwriting current file
...
Diffstat (limited to 'spec/javascripts/groups/service/groups_service_spec.js')
-rw-r--r-- | spec/javascripts/groups/service/groups_service_spec.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/javascripts/groups/service/groups_service_spec.js b/spec/javascripts/groups/service/groups_service_spec.js new file mode 100644 index 00000000000..20bb63687f7 --- /dev/null +++ b/spec/javascripts/groups/service/groups_service_spec.js @@ -0,0 +1,42 @@ +import Vue from 'vue'; +import VueResource from 'vue-resource'; + +import GroupsService from '~/groups/service/groups_service'; +import { mockEndpoint, mockParentGroupItem } from '../mock_data'; + +Vue.use(VueResource); + +describe('GroupsService', () => { + let service; + + beforeEach(() => { + service = new GroupsService(mockEndpoint); + }); + + describe('getGroups', () => { + it('should return promise for `GET` request on provided endpoint', () => { + spyOn(service.groups, 'get').and.stub(); + const queryParams = { + page: 2, + filter: 'git', + sort: 'created_asc', + archived: true, + }; + + service.getGroups(55, 2, 'git', 'created_asc', true); + expect(service.groups.get).toHaveBeenCalledWith({ parent_id: 55 }); + + service.getGroups(null, 2, 'git', 'created_asc', true); + expect(service.groups.get).toHaveBeenCalledWith(queryParams); + }); + }); + + describe('leaveGroup', () => { + it('should return promise for `DELETE` request on provided endpoint', () => { + spyOn(Vue.http, 'delete').and.stub(); + + service.leaveGroup(mockParentGroupItem.leavePath); + expect(Vue.http.delete).toHaveBeenCalledWith(mockParentGroupItem.leavePath); + }); + }); +}); |