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/projects/protected_branches_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/projects/protected_branches_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/protected_branches_controller_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/controllers/projects/protected_branches_controller_spec.rb b/spec/controllers/projects/protected_branches_controller_spec.rb index ac812707e74..483d3bbc37c 100644 --- a/spec/controllers/projects/protected_branches_controller_spec.rb +++ b/spec/controllers/projects/protected_branches_controller_spec.rb @@ -15,7 +15,7 @@ describe Projects::ProtectedBranchesController do let(:project) { create(:project_empty_repo, :public) } it "redirects empty repo to projects page" do - get(:index, namespace_id: project.namespace.to_param, project_id: project) + get(:index, params: { namespace_id: project.namespace.to_param, project_id: project }) end end @@ -33,7 +33,7 @@ describe Projects::ProtectedBranchesController do it 'creates the protected branch rule' do expect do - post(:create, project_params.merge(protected_branch: create_params)) + post(:create, params: project_params.merge(protected_branch: create_params)) end.to change(ProtectedBranch, :count).by(1) end @@ -44,7 +44,7 @@ describe Projects::ProtectedBranchesController do end it "prevents creation of the protected branch rule" do - post(:create, project_params.merge(protected_branch: create_params)) + post(:create, params: project_params.merge(protected_branch: create_params)) expect(ProtectedBranch.count).to eq 0 end @@ -59,7 +59,7 @@ describe Projects::ProtectedBranchesController do end it 'updates the protected branch rule' do - put(:update, base_params.merge(protected_branch: update_params)) + put(:update, params: base_params.merge(protected_branch: update_params)) expect(protected_branch.reload.name).to eq('new_name') expect(json_response["name"]).to eq('new_name') @@ -74,7 +74,7 @@ describe Projects::ProtectedBranchesController do it "prevents update of the protected branch rule" do old_name = protected_branch.name - put(:update, base_params.merge(protected_branch: update_params)) + put(:update, params: base_params.merge(protected_branch: update_params)) expect(protected_branch.reload.name).to eq(old_name) end @@ -87,7 +87,7 @@ describe Projects::ProtectedBranchesController do end it "deletes the protected branch rule" do - delete(:destroy, base_params) + delete(:destroy, params: base_params) expect { ProtectedBranch.find(protected_branch.id) }.to raise_error(ActiveRecord::RecordNotFound) end @@ -99,7 +99,7 @@ describe Projects::ProtectedBranchesController do end it "prevents deletion of the protected branch rule" do - delete(:destroy, base_params) + delete(:destroy, params: base_params) expect(response.status).to eq(403) end |