Commit d60243ed authored by Vitali Tatarintev's avatar Vitali Tatarintev

Rename params to exclude constant

parent d5b923d9
...@@ -19,7 +19,7 @@ module Projects ...@@ -19,7 +19,7 @@ module Projects
private private
FORBIDDEN_PARAMS = %w(controller action namespace_id project_id).freeze PARAMS_TO_EXCLUDE = %w(controller action namespace_id project_id).freeze
def project_without_auth def project_without_auth
@project ||= Project @project ||= Project
...@@ -51,7 +51,7 @@ module Projects ...@@ -51,7 +51,7 @@ module Projects
end end
def permitted_params def permitted_params
params.reject! { |param| param.in?(FORBIDDEN_PARAMS) }.permit! params.except(*PARAMS_TO_EXCLUDE).permit! # rubocop:disable CodeReuse/ActiveRecord
end end
end end
end end
......
...@@ -38,7 +38,7 @@ describe Projects::Alerting::NotificationsController do ...@@ -38,7 +38,7 @@ describe Projects::Alerting::NotificationsController do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
it 'does not pass forbidden parameters to the notify service' do it 'does not pass excluded parameters to the notify service' do
make_request(payload) make_request(payload)
expect(Projects::Alerting::NotifyService) expect(Projects::Alerting::NotifyService)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment