diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-21 03:08:23 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-21 03:08:23 +0000 |
commit | 11d02c98dccbbb145ba5229846c575759efb813f (patch) | |
tree | c517a491d99b40cb5b7e8a80b343322f6fba07e7 /spec/controllers/projects/commit_controller_spec.rb | |
parent | 6f0cd7387e3d1b380f478b66b4edfec2894ec32a (diff) | |
download | gitlab-ce-11d02c98dccbbb145ba5229846c575759efb813f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects/commit_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/commit_controller_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/controllers/projects/commit_controller_spec.rb b/spec/controllers/projects/commit_controller_spec.rb index 72fee40a6e9..509e10a10c7 100644 --- a/spec/controllers/projects/commit_controller_spec.rb +++ b/spec/controllers/projects/commit_controller_spec.rb @@ -212,6 +212,21 @@ RSpec.describe Projects::CommitController do end end + context 'when the revert commit is missing' do + it 'renders the 404 page' do + post(:revert, + params: { + namespace_id: project.namespace, + project_id: project, + start_branch: 'master', + id: '1234567890' + }) + + expect(response).not_to be_successful + expect(response).to have_gitlab_http_status(:not_found) + end + end + context 'when the revert was successful' do it 'redirects to the commits page' do post(:revert, @@ -269,6 +284,21 @@ RSpec.describe Projects::CommitController do end end + context 'when the cherry-pick commit is missing' do + it 'renders the 404 page' do + post(:cherry_pick, + params: { + namespace_id: project.namespace, + project_id: project, + start_branch: 'master', + id: '1234567890' + }) + + expect(response).not_to be_successful + expect(response).to have_gitlab_http_status(:not_found) + end + end + context 'when the cherry-pick was successful' do it 'redirects to the commits page' do post(:cherry_pick, |