summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/hooks_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-13 03:08:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-13 03:08:09 +0000
commite44c47168ab82d5ec1d945da7c33c2da5996e267 (patch)
treec55a881ad5ffe70b69400aa0620d0559319b3a35 /spec/controllers/projects/hooks_controller_spec.rb
parentdf4e4c33e0266171016df38c0a41e8c049ee114f (diff)
downloadgitlab-ce-e44c47168ab82d5ec1d945da7c33c2da5996e267.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects/hooks_controller_spec.rb')
-rw-r--r--spec/controllers/projects/hooks_controller_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/projects/hooks_controller_spec.rb b/spec/controllers/projects/hooks_controller_spec.rb
index 92a7be18c28..c056e7a33aa 100644
--- a/spec/controllers/projects/hooks_controller_spec.rb
+++ b/spec/controllers/projects/hooks_controller_spec.rb
@@ -173,6 +173,16 @@ RSpec.describe Projects::HooksController, feature_category: :integrations do
let(:params) { { namespace_id: project.namespace, project_id: project, id: hook } }
it_behaves_like 'Web hook destroyer'
+
+ context 'when user does not have permission' do
+ let(:user) { create(:user, developer_projects: [project]) }
+
+ it 'renders a 404' do
+ delete :destroy, params: params
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+ end
end
describe '#test' do