diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-18 09:52:17 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-19 10:04:31 +1100 |
commit | b44a2c801a64fb282cea794871fcfcf81e4ec539 (patch) | |
tree | 32e699b6efa548048abe11f29f84e85e3d2a034f /spec/controllers/groups/group_members_controller_spec.rb | |
parent | 5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff) | |
download | gitlab-ce-b44a2c801a64fb282cea794871fcfcf81e4ec539.tar.gz |
Update specs to rails5 formatblackst0ne-convert-specs-rails5-style
Updates specs to use new rails5 format.
The old format:
`get :show, { some: params }, { some: headers }`
The new format:
`get :show, params: { some: params }, headers: { some: headers }`
Diffstat (limited to 'spec/controllers/groups/group_members_controller_spec.rb')
-rw-r--r-- | spec/controllers/groups/group_members_controller_spec.rb | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/spec/controllers/groups/group_members_controller_spec.rb b/spec/controllers/groups/group_members_controller_spec.rb index 362d5cc4514..00a00306ff9 100644 --- a/spec/controllers/groups/group_members_controller_spec.rb +++ b/spec/controllers/groups/group_members_controller_spec.rb @@ -6,7 +6,7 @@ describe Groups::GroupMembersController do describe 'GET index' do it 'renders index with 200 status code' do - get :index, group_id: group + get :index, params: { group_id: group } expect(response).to have_gitlab_http_status(200) expect(response).to render_template(:index) @@ -26,9 +26,11 @@ describe Groups::GroupMembersController do end it 'returns 403' do - post :create, group_id: group, - user_ids: group_user.id, - access_level: Gitlab::Access::GUEST + post :create, params: { + group_id: group, + user_ids: group_user.id, + access_level: Gitlab::Access::GUEST + } expect(response).to have_gitlab_http_status(403) expect(group.users).not_to include group_user @@ -41,9 +43,11 @@ describe Groups::GroupMembersController do end it 'adds user to members' do - post :create, group_id: group, - user_ids: group_user.id, - access_level: Gitlab::Access::GUEST + post :create, params: { + group_id: group, + user_ids: group_user.id, + access_level: Gitlab::Access::GUEST + } expect(response).to set_flash.to 'Users were successfully added.' expect(response).to redirect_to(group_group_members_path(group)) @@ -51,9 +55,11 @@ describe Groups::GroupMembersController do end it 'adds no user to members' do - post :create, group_id: group, - user_ids: '', - access_level: Gitlab::Access::GUEST + post :create, params: { + group_id: group, + user_ids: '', + access_level: Gitlab::Access::GUEST + } expect(response).to set_flash.to 'No users specified.' expect(response).to redirect_to(group_group_members_path(group)) @@ -90,7 +96,7 @@ describe Groups::GroupMembersController do context 'when member is not found' do it 'returns 403' do - delete :destroy, group_id: group, id: 42 + delete :destroy, params: { group_id: group, id: 42 } expect(response).to have_gitlab_http_status(403) end @@ -103,7 +109,7 @@ describe Groups::GroupMembersController do end it 'returns 403' do - delete :destroy, group_id: group, id: member + delete :destroy, params: { group_id: group, id: member } expect(response).to have_gitlab_http_status(403) expect(group.members).to include member @@ -116,7 +122,7 @@ describe Groups::GroupMembersController do end it '[HTML] removes user from members' do - delete :destroy, group_id: group, id: member + delete :destroy, params: { group_id: group, id: member } expect(response).to set_flash.to 'User was successfully removed from group.' expect(response).to redirect_to(group_group_members_path(group)) @@ -140,7 +146,7 @@ describe Groups::GroupMembersController do context 'when member is not found' do it 'returns 404' do - delete :leave, group_id: group + delete :leave, params: { group_id: group } expect(response).to have_gitlab_http_status(404) end @@ -153,7 +159,7 @@ describe Groups::GroupMembersController do end it 'removes user from members' do - delete :leave, group_id: group + delete :leave, params: { group_id: group } expect(response).to set_flash.to "You left the \"#{group.name}\" group." expect(response).to redirect_to(dashboard_groups_path) @@ -161,7 +167,7 @@ describe Groups::GroupMembersController do end it 'supports json request' do - delete :leave, group_id: group, format: :json + delete :leave, params: { group_id: group }, format: :json expect(response).to have_gitlab_http_status(200) expect(json_response['notice']).to eq "You left the \"#{group.name}\" group." @@ -174,7 +180,7 @@ describe Groups::GroupMembersController do end it 'cannot removes himself from the group' do - delete :leave, group_id: group + delete :leave, params: { group_id: group } expect(response).to have_gitlab_http_status(403) end @@ -186,7 +192,7 @@ describe Groups::GroupMembersController do end it 'removes user from members' do - delete :leave, group_id: group + delete :leave, params: { group_id: group } expect(response).to set_flash.to 'Your access request to the group has been withdrawn.' expect(response).to redirect_to(group_path(group)) @@ -203,7 +209,7 @@ describe Groups::GroupMembersController do end it 'creates a new GroupMember that is not a team member' do - post :request_access, group_id: group + post :request_access, params: { group_id: group } expect(response).to set_flash.to 'Your request for access has been queued for review.' expect(response).to redirect_to(group_path(group)) @@ -221,7 +227,7 @@ describe Groups::GroupMembersController do context 'when member is not found' do it 'returns 403' do - post :approve_access_request, group_id: group, id: 42 + post :approve_access_request, params: { group_id: group, id: 42 } expect(response).to have_gitlab_http_status(403) end @@ -234,7 +240,7 @@ describe Groups::GroupMembersController do end it 'returns 403' do - post :approve_access_request, group_id: group, id: member + post :approve_access_request, params: { group_id: group, id: member } expect(response).to have_gitlab_http_status(403) expect(group.members).not_to include member @@ -247,7 +253,7 @@ describe Groups::GroupMembersController do end it 'adds user to members' do - post :approve_access_request, group_id: group, id: member + post :approve_access_request, params: { group_id: group, id: member } expect(response).to redirect_to(group_group_members_path(group)) expect(group.members).to include member |