Commit b41a39bc authored by Rajendra Kadam's avatar Rajendra Kadam

Refactor function inside it_behaves_like and add issue link in doc

parent bd3388f3
...@@ -492,7 +492,7 @@ Parameters: ...@@ -492,7 +492,7 @@ Parameters:
| `auto_devops_enabled` | boolean | no | Default to Auto DevOps pipeline for all projects within this group. | | `auto_devops_enabled` | boolean | no | Default to Auto DevOps pipeline for all projects within this group. |
| `subgroup_creation_level` | string | no | Allowed to create subgroups. Can be `owner` (Owners), or `maintainer` (Maintainers). | | `subgroup_creation_level` | string | no | Allowed to create subgroups. Can be `owner` (Owners), or `maintainer` (Maintainers). |
| `emails_disabled` | boolean | no | Disable email notifications | | `emails_disabled` | boolean | no | Disable email notifications |
| `avatar` | mixed | no | Image file for avatar of the group | | `avatar` | mixed | no | Image file for avatar of the group. [Introduced in GitLab 12.9](https://gitlab.com/gitlab-org/gitlab/issues/36681) |
| `mentions_disabled` | boolean | no | Disable the capability of a group from getting mentioned | | `mentions_disabled` | boolean | no | Disable the capability of a group from getting mentioned |
| `lfs_enabled` | boolean | no | Enable/disable Large File Storage (LFS) for the projects in this group. | | `lfs_enabled` | boolean | no | Enable/disable Large File Storage (LFS) for the projects in this group. |
| `request_access_enabled` | boolean | no | Allow users to request member access. | | `request_access_enabled` | boolean | no | Allow users to request member access. |
...@@ -554,7 +554,7 @@ PUT /groups/:id ...@@ -554,7 +554,7 @@ PUT /groups/:id
| `auto_devops_enabled` | boolean | no | Default to Auto DevOps pipeline for all projects within this group. | | `auto_devops_enabled` | boolean | no | Default to Auto DevOps pipeline for all projects within this group. |
| `subgroup_creation_level` | string | no | Allowed to create subgroups. Can be `owner` (Owners), or `maintainer` (Maintainers). | | `subgroup_creation_level` | string | no | Allowed to create subgroups. Can be `owner` (Owners), or `maintainer` (Maintainers). |
| `emails_disabled` | boolean | no | Disable email notifications | | `emails_disabled` | boolean | no | Disable email notifications |
| `avatar` | mixed | no | Image file for avatar of the group | | `avatar` | mixed | no | Image file for avatar of the group. [Introduced in GitLab 12.9](https://gitlab.com/gitlab-org/gitlab/issues/36681) |
| `mentions_disabled` | boolean | no | Disable the capability of a group from getting mentioned | | `mentions_disabled` | boolean | no | Disable the capability of a group from getting mentioned |
| `lfs_enabled` (optional) | boolean | no | Enable/disable Large File Storage (LFS) for the projects in this group. | | `lfs_enabled` (optional) | boolean | no | Enable/disable Large File Storage (LFS) for the projects in this group. |
| `request_access_enabled` | boolean | no | Allow users to request member access. | | `request_access_enabled` | boolean | no | Allow users to request member access. |
......
...@@ -580,15 +580,15 @@ describe API::Groups do ...@@ -580,15 +580,15 @@ describe API::Groups do
describe 'PUT /groups/:id' do describe 'PUT /groups/:id' do
let(:new_group_name) { 'New Group'} let(:new_group_name) { 'New Group'}
def make_upload_request it_behaves_like 'group avatar upload' do
group_param = { def make_upload_request
avatar: fixture_file_upload(file_path) group_param = {
} avatar: fixture_file_upload(file_path)
put api("/groups/#{group1.id}", user1), params: group_param }
put api("/groups/#{group1.id}", user1), params: group_param
end
end end
it_behaves_like 'group avatar upload'
context 'when authenticated as the group owner' do context 'when authenticated as the group owner' do
it 'updates the group' do it 'updates the group' do
put api("/groups/#{group1.id}", user1), params: { put api("/groups/#{group1.id}", user1), params: {
...@@ -990,13 +990,15 @@ describe API::Groups do ...@@ -990,13 +990,15 @@ describe API::Groups do
end end
describe "POST /groups" do describe "POST /groups" do
def make_upload_request it_behaves_like 'group avatar upload' do
group = attributes_for_group_api request_access_enabled: false def make_upload_request
group[:avatar] = fixture_file_upload(file_path) params = attributes_for_group_api(request_access_enabled: false).tap do |attrs|
post api("/groups", user3), params: group attrs[:avatar] = fixture_file_upload(file_path)
end end
it_behaves_like 'group avatar upload' post api("/groups", user3), params: params
end
end
context "when authenticated as user without group permissions" do context "when authenticated as user without group permissions" do
it "does not create group" do it "does not create group" do
......
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