summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/commit_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/projects/commit_controller_spec.rb')
-rw-r--r--spec/controllers/projects/commit_controller_spec.rb30
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,