summaryrefslogtreecommitdiff
path: root/spec/controllers/groups
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-12-18 09:52:17 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2018-12-19 10:04:31 +1100
commitb44a2c801a64fb282cea794871fcfcf81e4ec539 (patch)
tree32e699b6efa548048abe11f29f84e85e3d2a034f /spec/controllers/groups
parent5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff)
downloadgitlab-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')
-rw-r--r--spec/controllers/groups/avatars_controller_spec.rb2
-rw-r--r--spec/controllers/groups/boards_controller_spec.rb8
-rw-r--r--spec/controllers/groups/children_controller_spec.rb42
-rw-r--r--spec/controllers/groups/clusters/applications_controller_spec.rb2
-rw-r--r--spec/controllers/groups/clusters_controller_spec.rb28
-rw-r--r--spec/controllers/groups/group_members_controller_spec.rb50
-rw-r--r--spec/controllers/groups/labels_controller_spec.rb6
-rw-r--r--spec/controllers/groups/milestones_controller_spec.rb68
-rw-r--r--spec/controllers/groups/runners_controller_spec.rb8
-rw-r--r--spec/controllers/groups/settings/ci_cd_controller_spec.rb4
-rw-r--r--spec/controllers/groups/shared_projects_controller_spec.rb2
-rw-r--r--spec/controllers/groups/uploads_controller_spec.rb2
-rw-r--r--spec/controllers/groups/variables_controller_spec.rb8
13 files changed, 129 insertions, 101 deletions
diff --git a/spec/controllers/groups/avatars_controller_spec.rb b/spec/controllers/groups/avatars_controller_spec.rb
index 7feecd0c380..772d1d0c1dd 100644
--- a/spec/controllers/groups/avatars_controller_spec.rb
+++ b/spec/controllers/groups/avatars_controller_spec.rb
@@ -10,7 +10,7 @@ describe Groups::AvatarsController do
end
it 'removes avatar from DB calling destroy' do
- delete :destroy, group_id: group.path
+ delete :destroy, params: { group_id: group.path }
@group = assigns(:group)
expect(@group.avatar.present?).to be_falsey
expect(@group).to be_valid
diff --git a/spec/controllers/groups/boards_controller_spec.rb b/spec/controllers/groups/boards_controller_spec.rb
index 99429c93b82..4228e727b52 100644
--- a/spec/controllers/groups/boards_controller_spec.rb
+++ b/spec/controllers/groups/boards_controller_spec.rb
@@ -105,7 +105,7 @@ describe Groups::BoardsController do
end
def list_boards(format: :html)
- get :index, group_id: group, format: format
+ get :index, params: { group_id: group }, format: format
end
end
@@ -183,8 +183,10 @@ describe Groups::BoardsController do
end
def read_board(board:, format: :html)
- get :show, group_id: group,
- id: board.to_param,
+ get :show, params: {
+ group_id: group,
+ id: board.to_param
+ },
format: format
end
end
diff --git a/spec/controllers/groups/children_controller_spec.rb b/spec/controllers/groups/children_controller_spec.rb
index 22d3076c269..4d5bb1488ab 100644
--- a/spec/controllers/groups/children_controller_spec.rb
+++ b/spec/controllers/groups/children_controller_spec.rb
@@ -16,7 +16,7 @@ describe Groups::ChildrenController do
end
it 'shows all children' do
- get :index, group_id: group.to_param, format: :json
+ get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_project, private_project)
end
@@ -26,7 +26,7 @@ describe Groups::ChildrenController do
group_member.destroy!
private_project.add_guest(user)
- get :index, group_id: group.to_param, format: :json
+ get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_project, private_project)
end
@@ -35,7 +35,7 @@ describe Groups::ChildrenController do
context 'as a guest' do
it 'shows the public children' do
- get :index, group_id: group.to_param, format: :json
+ get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_project)
end
@@ -54,7 +54,7 @@ describe Groups::ChildrenController do
end
it 'shows all children' do
- get :index, group_id: group.to_param, format: :json
+ get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_subgroup, private_subgroup, public_project, private_project)
end
@@ -65,7 +65,7 @@ describe Groups::ChildrenController do
private_subgroup.add_guest(user)
private_project.add_guest(user)
- get :index, group_id: group.to_param, format: :json
+ get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_subgroup, private_subgroup, public_project, private_project)
end
@@ -74,7 +74,7 @@ describe Groups::ChildrenController do
context 'as a guest' do
it 'shows the public children' do
- get :index, group_id: group.to_param, format: :json
+ get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_subgroup, public_project)
end
@@ -84,7 +84,7 @@ describe Groups::ChildrenController do
it 'expands the tree for matching projects' do
project = create(:project, :public, namespace: public_subgroup, name: 'filterme')
- get :index, group_id: group.to_param, filter: 'filter', format: :json
+ get :index, params: { group_id: group.to_param, filter: 'filter' }, format: :json
group_json = json_response.first
project_json = group_json['children'].first
@@ -96,7 +96,7 @@ describe Groups::ChildrenController do
it 'expands the tree for matching subgroups' do
matched_group = create(:group, :public, parent: public_subgroup, name: 'filterme')
- get :index, group_id: group.to_param, filter: 'filter', format: :json
+ get :index, params: { group_id: group.to_param, filter: 'filter' }, format: :json
group_json = json_response.first
matched_group_json = group_json['children'].first
@@ -113,7 +113,7 @@ describe Groups::ChildrenController do
l3_subgroup = create(:group, :public, parent: l2_subgroup, path: 'wifi-group')
matched_project_2 = create(:project, :public, namespace: l3_subgroup, name: 'mobile')
- get :index, group_id: group.to_param, filter: 'mobile', format: :json
+ get :index, params: { group_id: group.to_param, filter: 'mobile' }, format: :json
shared_group_json = json_response.first
expect(shared_group_json['id']).to eq(shared_subgroup.id)
@@ -136,7 +136,7 @@ describe Groups::ChildrenController do
l2_subgroup = create(:group, :public, parent: subgroup)
create(:project, :public, namespace: l2_subgroup, name: 'test')
- get :index, group_id: subgroup.to_param, filter: 'test', format: :json
+ get :index, params: { group_id: subgroup.to_param, filter: 'test' }, format: :json
expect(response).to have_http_status(200)
end
@@ -144,7 +144,7 @@ describe Groups::ChildrenController do
it 'returns an array with one element when only one result is matched' do
create(:project, :public, namespace: group, name: 'match')
- get :index, group_id: group.to_param, filter: 'match', format: :json
+ get :index, params: { group_id: group.to_param, filter: 'match' }, format: :json
expect(json_response).to be_kind_of(Array)
expect(json_response.size).to eq(1)
@@ -155,7 +155,7 @@ describe Groups::ChildrenController do
l2_subgroup = create(:group, :public, parent: subgroup)
create(:project, :public, namespace: l2_subgroup, name: 'no-match')
- get :index, group_id: subgroup.to_param, filter: 'test', format: :json
+ get :index, params: { group_id: subgroup.to_param, filter: 'test' }, format: :json
expect(json_response).to eq([])
end
@@ -179,7 +179,7 @@ describe Groups::ChildrenController do
end
group_to_nest.update!(parent: subgroup)
- get :index, group_id: group.to_param, filter: 'filter', per_page: 3, format: :json
+ get :index, params: { group_id: group.to_param, filter: 'filter', per_page: 3 }, format: :json
expect(response).to have_gitlab_http_status(200)
end
@@ -187,7 +187,7 @@ describe Groups::ChildrenController do
it 'includes pagination headers' do
2.times { |i| create(:group, :public, parent: public_subgroup, name: "filterme#{i}") }
- get :index, group_id: group.to_param, filter: 'filter', per_page: 1, format: :json
+ get :index, params: { group_id: group.to_param, filter: 'filter', per_page: 1 }, format: :json
expect(response).to include_pagination_headers
end
@@ -203,7 +203,7 @@ describe Groups::ChildrenController do
let(:expected_queries_per_project) { 0 }
def get_list
- get :index, group_id: group.to_param, format: :json
+ get :index, params: { group_id: group.to_param }, format: :json
end
it 'queries the expected amount for a group row' do
@@ -227,7 +227,7 @@ describe Groups::ChildrenController do
let(:extra_queries_for_hierarchies) { 1 }
def get_filtered_list
- get :index, group_id: group.to_param, filter: 'filter', format: :json
+ get :index, params: { group_id: group.to_param, filter: 'filter' }, format: :json
end
it 'queries the expected amount when nested rows are increased for a group' do
@@ -276,13 +276,13 @@ describe Groups::ChildrenController do
let!(:first_page_projects) { create_list(:project, per_page, :public, namespace: group ) }
it 'has projects on the first page' do
- get :index, group_id: group.to_param, sort: 'id_desc', format: :json
+ get :index, params: { group_id: group.to_param, sort: 'id_desc' }, format: :json
expect(assigns(:children)).to contain_exactly(*first_page_projects)
end
it 'has projects on the second page' do
- get :index, group_id: group.to_param, sort: 'id_desc', page: 2, format: :json
+ get :index, params: { group_id: group.to_param, sort: 'id_desc', page: 2 }, format: :json
expect(assigns(:children)).to contain_exactly(other_project)
end
@@ -294,13 +294,13 @@ describe Groups::ChildrenController do
let!(:next_page_projects) { create_list(:project, per_page, :public, namespace: group) }
it 'contains all subgroups' do
- get :index, group_id: group.to_param, sort: 'id_asc', format: :json
+ get :index, params: { group_id: group.to_param, sort: 'id_asc' }, format: :json
expect(assigns(:children)).to contain_exactly(*first_page_subgroups)
end
it 'contains the project and group on the second page' do
- get :index, group_id: group.to_param, sort: 'id_asc', page: 2, format: :json
+ get :index, params: { group_id: group.to_param, sort: 'id_asc', page: 2 }, format: :json
expect(assigns(:children)).to contain_exactly(other_subgroup, *next_page_projects.take(per_page - 1))
end
@@ -310,7 +310,7 @@ describe Groups::ChildrenController do
let!(:first_page_projects) { create_list(:project, per_page, :public, namespace: group) }
it 'correctly calculates the counts' do
- get :index, group_id: group.to_param, sort: 'id_asc', page: 2, format: :json
+ get :index, params: { group_id: group.to_param, sort: 'id_asc', page: 2 }, format: :json
expect(response).to have_gitlab_http_status(200)
end
diff --git a/spec/controllers/groups/clusters/applications_controller_spec.rb b/spec/controllers/groups/clusters/applications_controller_spec.rb
index 68a798542b6..dd5263b077c 100644
--- a/spec/controllers/groups/clusters/applications_controller_spec.rb
+++ b/spec/controllers/groups/clusters/applications_controller_spec.rb
@@ -81,7 +81,7 @@ describe Groups::Clusters::ApplicationsController do
end
def go
- post :create, params.merge(group_id: group)
+ post :create, params: params.merge(group_id: group)
end
end
end
diff --git a/spec/controllers/groups/clusters_controller_spec.rb b/spec/controllers/groups/clusters_controller_spec.rb
index 6e130f830a2..0f28499194e 100644
--- a/spec/controllers/groups/clusters_controller_spec.rb
+++ b/spec/controllers/groups/clusters_controller_spec.rb
@@ -17,7 +17,7 @@ describe Groups::ClustersController do
describe 'GET index' do
def go(params = {})
- get :index, params.reverse_merge(group_id: group)
+ get :index, params: params.reverse_merge(group_id: group)
end
context 'when feature flag is not enabled' do
@@ -104,7 +104,7 @@ describe Groups::ClustersController do
describe 'GET new' do
def go
- get :new, group_id: group
+ get :new, params: { group_id: group }
end
describe 'functionality for new cluster' do
@@ -198,7 +198,7 @@ describe Groups::ClustersController do
end
def go
- post :create_gcp, params.merge(group_id: group)
+ post :create_gcp, params: params.merge(group_id: group)
end
describe 'functionality' do
@@ -287,7 +287,7 @@ describe Groups::ClustersController do
end
def go
- post :create_user, params.merge(group_id: group)
+ post :create_user, params: params.merge(group_id: group)
end
describe 'functionality' do
@@ -353,8 +353,10 @@ describe Groups::ClustersController do
def go
get :cluster_status,
- group_id: group.to_param,
- id: cluster,
+ params: {
+ group_id: group.to_param,
+ id: cluster
+ },
format: :json
end
@@ -390,8 +392,10 @@ describe Groups::ClustersController do
def go
get :show,
- group_id: group,
- id: cluster
+ params: {
+ group_id: group,
+ id: cluster
+ }
end
describe 'functionality' do
@@ -417,7 +421,7 @@ describe Groups::ClustersController do
describe 'PUT update' do
def go(format: :html)
- put :update, params.merge(
+ put :update, params: params.merge(
group_id: group.to_param,
id: cluster,
format: format
@@ -505,8 +509,10 @@ describe Groups::ClustersController do
def go
delete :destroy,
- group_id: group,
- id: cluster
+ params: {
+ group_id: group,
+ id: cluster
+ }
end
describe 'functionality' do
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
diff --git a/spec/controllers/groups/labels_controller_spec.rb b/spec/controllers/groups/labels_controller_spec.rb
index 185b6b4ce57..fa664a29066 100644
--- a/spec/controllers/groups/labels_controller_spec.rb
+++ b/spec/controllers/groups/labels_controller_spec.rb
@@ -16,7 +16,7 @@ describe Groups::LabelsController do
set(:group_label_1) { create(:group_label, group: group, title: 'group_label_1') }
it 'returns group and project labels by default' do
- get :index, group_id: group, format: :json
+ get :index, params: { group_id: group }, format: :json
label_ids = json_response.map {|label| label['title']}
expect(label_ids).to match_array([label_1.title, group_label_1.title])
@@ -31,7 +31,7 @@ describe Groups::LabelsController do
end
it 'returns ancestor group labels', :nested_groups do
- get :index, group_id: subgroup, include_ancestor_groups: true, only_group_labels: true, format: :json
+ get :index, params: { group_id: subgroup, include_ancestor_groups: true, only_group_labels: true }, format: :json
label_ids = json_response.map {|label| label['title']}
expect(label_ids).to match_array([group_label_1.title, subgroup_label_1.title])
@@ -43,7 +43,7 @@ describe Groups::LabelsController do
it 'allows user to toggle subscription on group labels' do
label = create(:group_label, group: group)
- post :toggle_subscription, group_id: group.to_param, id: label.to_param
+ post :toggle_subscription, params: { group_id: group.to_param, id: label.to_param }
expect(response).to have_gitlab_http_status(200)
end
diff --git a/spec/controllers/groups/milestones_controller_spec.rb b/spec/controllers/groups/milestones_controller_spec.rb
index 42723bb3820..b8e1e08cff7 100644
--- a/spec/controllers/groups/milestones_controller_spec.rb
+++ b/spec/controllers/groups/milestones_controller_spec.rb
@@ -33,7 +33,7 @@ describe Groups::MilestonesController do
describe '#index' do
it 'shows group milestones page' do
- get :index, group_id: group.to_param
+ get :index, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(200)
end
@@ -44,7 +44,7 @@ describe Groups::MilestonesController do
let!(:legacy_milestone2) { create(:milestone, project: project2, title: 'legacy') }
it 'lists legacy group milestones and group milestones' do
- get :index, group_id: group.to_param, format: :json
+ get :index, params: { group_id: group.to_param }, format: :json
milestones = JSON.parse(response.body)
@@ -67,7 +67,7 @@ describe Groups::MilestonesController do
expect(GlobalMilestone).to receive(:build)
expect(Milestone).not_to receive(:find_by_iid)
- get :show, group_id: group.to_param, id: title, title: milestone1.safe_title
+ get :show, params: { group_id: group.to_param, id: title, title: milestone1.safe_title }
end
end
@@ -76,7 +76,7 @@ describe Groups::MilestonesController do
expect(GlobalMilestone).not_to receive(:build)
expect(Milestone).to receive(:find_by_iid)
- get :show, group_id: group.to_param, id: group_milestone.id
+ get :show, params: { group_id: group.to_param, id: group_milestone.id }
end
end
end
@@ -86,8 +86,10 @@ describe Groups::MilestonesController do
describe "#create" do
it "creates group milestone with Chinese title" do
post :create,
- group_id: group.to_param,
- milestone: milestone_params
+ params: {
+ group_id: group.to_param,
+ milestone: milestone_params
+ }
milestone = Milestone.find_by_title(title)
@@ -105,9 +107,11 @@ describe Groups::MilestonesController do
milestone_params[:title] = "title changed"
put :update,
- id: milestone.iid,
- group_id: group.to_param,
- milestone: milestone_params
+ params: {
+ id: milestone.iid,
+ group_id: group.to_param,
+ milestone: milestone_params
+ }
milestone.reload
expect(response).to redirect_to(group_milestone_path(group, milestone.iid))
@@ -124,10 +128,12 @@ describe Groups::MilestonesController do
milestone_params[:state_event] = "close"
put :update,
- id: milestone1.title.to_slug.to_s,
- group_id: group.to_param,
- milestone: milestone_params,
- title: milestone1.title
+ params: {
+ id: milestone1.title.to_slug.to_s,
+ group_id: group.to_param,
+ milestone: milestone_params,
+ title: milestone1.title
+ }
expect(response).to redirect_to(group_milestone_path(group, milestone1.safe_title, title: milestone1.title))
@@ -145,7 +151,7 @@ describe Groups::MilestonesController do
let(:milestone) { create(:milestone, group: group) }
it "removes milestone" do
- delete :destroy, group_id: group.to_param, id: milestone.iid, format: :js
+ delete :destroy, params: { group_id: group.to_param, id: milestone.iid }, format: :js
expect(response).to be_success
expect { Milestone.find(milestone.id) }.to raise_exception(ActiveRecord::RecordNotFound)
@@ -162,7 +168,7 @@ describe Groups::MilestonesController do
context 'non-show path' do
context 'with exactly matching casing' do
it 'does not redirect' do
- get :index, group_id: group.to_param
+ get :index, params: { group_id: group.to_param }
expect(response).not_to have_gitlab_http_status(301)
end
@@ -170,7 +176,7 @@ describe Groups::MilestonesController do
context 'with different casing' do
it 'redirects to the correct casing' do
- get :index, group_id: group.to_param.upcase
+ get :index, params: { group_id: group.to_param.upcase }
expect(response).to redirect_to(group_milestones_path(group.to_param))
expect(controller).not_to set_flash[:notice]
@@ -181,7 +187,7 @@ describe Groups::MilestonesController do
context 'show path' do
context 'with exactly matching casing' do
it 'does not redirect' do
- get :show, group_id: group.to_param, id: title
+ get :show, params: { group_id: group.to_param, id: title }
expect(response).not_to have_gitlab_http_status(301)
end
@@ -189,7 +195,7 @@ describe Groups::MilestonesController do
context 'with different casing' do
it 'redirects to the correct casing' do
- get :show, group_id: group.to_param.upcase, id: title
+ get :show, params: { group_id: group.to_param.upcase, id: title }
expect(response).to redirect_to(group_milestone_path(group.to_param, title))
expect(controller).not_to set_flash[:notice]
@@ -202,7 +208,7 @@ describe Groups::MilestonesController do
let(:redirect_route) { group.redirect_routes.create(path: 'old-path') }
it 'redirects to the canonical path' do
- get :merge_requests, group_id: redirect_route.path, id: title
+ get :merge_requests, params: { group_id: redirect_route.path, id: title }
expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
@@ -212,7 +218,7 @@ describe Groups::MilestonesController do
let(:redirect_route) { group.redirect_routes.create(path: 'http') }
it 'does not modify the requested host' do
- get :merge_requests, group_id: redirect_route.path, id: title
+ get :merge_requests, params: { group_id: redirect_route.path, id: title }
expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
@@ -224,7 +230,7 @@ describe Groups::MilestonesController do
let(:redirect_route) { group.redirect_routes.create(path: 'oups') }
it 'does not modify the /groups part of the path' do
- get :merge_requests, group_id: redirect_route.path, id: title
+ get :merge_requests, params: { group_id: redirect_route.path, id: title }
expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
@@ -236,7 +242,7 @@ describe Groups::MilestonesController do
let(:redirect_route) { group.redirect_routes.create(path: 'oups/oup') }
it 'does not modify the /groups part of the path' do
- get :merge_requests, group_id: redirect_route.path, id: title
+ get :merge_requests, params: { group_id: redirect_route.path, id: title }
expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
@@ -250,16 +256,20 @@ describe Groups::MilestonesController do
context 'when requesting the canonical path with different casing' do
it 'does not 404' do
post :create,
- group_id: group.to_param,
- milestone: { title: title }
+ params: {
+ group_id: group.to_param,
+ milestone: { title: title }
+ }
expect(response).not_to have_gitlab_http_status(404)
end
it 'does not redirect to the correct casing' do
post :create,
- group_id: group.to_param,
- milestone: { title: title }
+ params: {
+ group_id: group.to_param,
+ milestone: { title: title }
+ }
expect(response).not_to have_gitlab_http_status(301)
end
@@ -270,8 +280,10 @@ describe Groups::MilestonesController do
it 'returns not found' do
post :create,
- group_id: redirect_route.path,
- milestone: { title: title }
+ params: {
+ group_id: redirect_route.path,
+ milestone: { title: title }
+ }
expect(response).to have_gitlab_http_status(404)
end
diff --git a/spec/controllers/groups/runners_controller_spec.rb b/spec/controllers/groups/runners_controller_spec.rb
index 598fb84552f..469459bfc02 100644
--- a/spec/controllers/groups/runners_controller_spec.rb
+++ b/spec/controllers/groups/runners_controller_spec.rb
@@ -22,7 +22,7 @@ describe Groups::RunnersController do
new_desc = runner.description.swapcase
expect do
- post :update, params.merge(runner: { description: new_desc } )
+ post :update, params: params.merge(runner: { description: new_desc } )
end.to change { runner.ensure_runner_queue_value }
runner.reload
@@ -34,7 +34,7 @@ describe Groups::RunnersController do
describe '#destroy' do
it 'destroys the runner' do
- delete :destroy, params
+ delete :destroy, params: params
expect(response).to have_gitlab_http_status(302)
expect(Ci::Runner.find_by(id: runner.id)).to be_nil
@@ -46,7 +46,7 @@ describe Groups::RunnersController do
runner.update(active: false)
expect do
- post :resume, params
+ post :resume, params: params
end.to change { runner.ensure_runner_queue_value }
runner.reload
@@ -61,7 +61,7 @@ describe Groups::RunnersController do
runner.update(active: true)
expect do
- post :pause, params
+ post :pause, params: params
end.to change { runner.ensure_runner_queue_value }
runner.reload
diff --git a/spec/controllers/groups/settings/ci_cd_controller_spec.rb b/spec/controllers/groups/settings/ci_cd_controller_spec.rb
index 06ccace8242..b7f04f732b9 100644
--- a/spec/controllers/groups/settings/ci_cd_controller_spec.rb
+++ b/spec/controllers/groups/settings/ci_cd_controller_spec.rb
@@ -11,7 +11,7 @@ describe Groups::Settings::CiCdController do
describe 'GET #show' do
it 'renders show with 200 status code' do
- get :show, group_id: group
+ get :show, params: { group_id: group }
expect(response).to have_gitlab_http_status(200)
expect(response).to render_template(:show)
@@ -19,7 +19,7 @@ describe Groups::Settings::CiCdController do
end
describe 'PUT #reset_registration_token' do
- subject { put :reset_registration_token, group_id: group }
+ subject { put :reset_registration_token, params: { group_id: group } }
it 'resets runner registration token' do
expect { subject }.to change { group.reload.runners_token }
diff --git a/spec/controllers/groups/shared_projects_controller_spec.rb b/spec/controllers/groups/shared_projects_controller_spec.rb
index 003c8c262e7..dab7700cf64 100644
--- a/spec/controllers/groups/shared_projects_controller_spec.rb
+++ b/spec/controllers/groups/shared_projects_controller_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe Groups::SharedProjectsController do
def get_shared_projects(params = {})
- get :index, params.reverse_merge(format: :json, group_id: group.full_path)
+ get :index, params: params.reverse_merge(format: :json, group_id: group.full_path)
end
def share_project(project)
diff --git a/spec/controllers/groups/uploads_controller_spec.rb b/spec/controllers/groups/uploads_controller_spec.rb
index 5a7281ed704..0104ba827da 100644
--- a/spec/controllers/groups/uploads_controller_spec.rb
+++ b/spec/controllers/groups/uploads_controller_spec.rb
@@ -15,6 +15,6 @@ describe Groups::UploadsController do
def post_authorize(verified: true)
request.headers.merge!(workhorse_internal_api_request_header) if verified
- post :authorize, group_id: model.full_path, format: :json
+ post :authorize, params: { group_id: model.full_path }, format: :json
end
end
diff --git a/spec/controllers/groups/variables_controller_spec.rb b/spec/controllers/groups/variables_controller_spec.rb
index e5ac5634f95..29ec3588316 100644
--- a/spec/controllers/groups/variables_controller_spec.rb
+++ b/spec/controllers/groups/variables_controller_spec.rb
@@ -13,7 +13,7 @@ describe Groups::VariablesController do
let!(:variable) { create(:ci_group_variable, group: group) }
subject do
- get :show, group_id: group, format: :json
+ get :show, params: { group_id: group }, format: :json
end
include_examples 'GET #show lists all variables'
@@ -25,8 +25,10 @@ describe Groups::VariablesController do
subject do
patch :update,
- group_id: group,
- variables_attributes: variables_attributes,
+ params: {
+ group_id: group,
+ variables_attributes: variables_attributes
+ },
format: :json
end