diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-18 01:52:17 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-19 02:04:31 +0300 |
commit | b44a2c801a64fb282cea794871fcfcf81e4ec539 (patch) | |
tree | 32e699b6efa548048abe11f29f84e85e3d2a034f /spec/controllers/concerns | |
parent | 5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff) |
Update specs to rails5 format
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/concerns')
3 files changed, 11 insertions, 11 deletions
diff --git a/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb b/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb index 3c9452cc42a..9b2d054f4fc 100644 --- a/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb +++ b/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb @@ -70,7 +70,7 @@ describe ControllerWithCrossProjectAccessCheck do end it 'correctly renders an action that does not require cross project access' do - get :show, id: 'nothing' + get :show, params: { id: 'nothing' } expect(response).to have_gitlab_http_status(200) end @@ -131,13 +131,13 @@ describe ControllerWithCrossProjectAccessCheck do end it 'does not skip the check on an action that is not skipped' do - get :show, id: 'hello' + get :show, params: { id: 'hello' } expect(response).to have_gitlab_http_status(403) end it 'does not skip the check on an action that was not defined to skip' do - get :edit, id: 'hello' + get :edit, params: { id: 'hello' } expect(response).to have_gitlab_http_status(403) end diff --git a/spec/controllers/concerns/group_tree_spec.rb b/spec/controllers/concerns/group_tree_spec.rb index 503eb416962..9fe17210d50 100644 --- a/spec/controllers/concerns/group_tree_spec.rb +++ b/spec/controllers/concerns/group_tree_spec.rb @@ -23,7 +23,7 @@ describe GroupTree do other_group = create(:group, name: 'filter') other_group.add_owner(user) - get :index, filter: 'filt', format: :json + get :index, params: { filter: 'filt' }, format: :json expect(assigns(:groups)).to contain_exactly(other_group) end @@ -40,7 +40,7 @@ describe GroupTree do it 'contains only the subgroup when a parent was given' do subgroup = create(:group, :public, parent: group) - get :index, parent_id: group.id, format: :json + get :index, params: { parent_id: group.id }, format: :json expect(assigns(:groups)).to contain_exactly(subgroup) end @@ -48,7 +48,7 @@ describe GroupTree do it 'allows filtering for subgroups and includes the parents for rendering' do subgroup = create(:group, :public, parent: group, name: 'filter') - get :index, filter: 'filt', format: :json + get :index, params: { filter: 'filt' }, format: :json expect(assigns(:groups)).to contain_exactly(group, subgroup) end @@ -59,7 +59,7 @@ describe GroupTree do subgroup.add_developer(user) _other_subgroup = create(:group, :private, parent: parent, name: 'filte') - get :index, filter: 'filt', format: :json + get :index, params: { filter: 'filt' }, format: :json expect(assigns(:groups)).to contain_exactly(parent, subgroup) end @@ -70,7 +70,7 @@ describe GroupTree do subgroup = create(:group, :public, parent: group) search_result = create(:group, :public, name: 'result', parent: subgroup) - get :index, filter: 'resu', format: :json + get :index, params: { filter: 'resu' }, format: :json expect(assigns(:groups)).to contain_exactly(group, subgroup, search_result) end @@ -87,7 +87,7 @@ describe GroupTree do it 'expands the tree when filtering' do subgroup = create(:group, :public, parent: group, name: 'filter') - get :index, filter: 'filt', format: :json + get :index, params: { filter: 'filt' }, format: :json children_response = json_response.first['children'] diff --git a/spec/controllers/concerns/lfs_request_spec.rb b/spec/controllers/concerns/lfs_request_spec.rb index 76c878ec5d7..7b49d4b6a3a 100644 --- a/spec/controllers/concerns/lfs_request_spec.rb +++ b/spec/controllers/concerns/lfs_request_spec.rb @@ -34,7 +34,7 @@ describe LfsRequest do describe '#storage_project' do it 'assigns the project as storage project' do - get :show, id: project.id + get :show, params: { id: project.id } expect(assigns(:storage_project)).to eq(project) end @@ -42,7 +42,7 @@ describe LfsRequest do it 'assigns the source of a forked project' do forked_project = fork_project(project) - get :show, id: forked_project.id + get :show, params: { id: forked_project.id } expect(assigns(:storage_project)).to eq(project) end |