Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-08-13 21:13:37 +0300
committerStan Hu <stanhu@gmail.com>2019-08-13 21:13:37 +0300
commitb6c51f57dd5637aaa4a45b7408a1f8b30ce3e7e3 (patch)
tree3e946b5af691ad3f3804d3e5a5fdf5f524da0cb0 /spec/controllers
parentbd759eebcd3d824bc95b08d91dcaf705b05769bb (diff)
Return 429 on rate limiter on raw endpoint
It was originally returning 302 when the rate limit kicks in, because using the the correct status code makes it easier to track rate limiting events Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/65974
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/raw_controller_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/controllers/projects/raw_controller_spec.rb b/spec/controllers/projects/raw_controller_spec.rb
index 8ee3168273f..b958f419a19 100644
--- a/spec/controllers/projects/raw_controller_spec.rb
+++ b/spec/controllers/projects/raw_controller_spec.rb
@@ -60,7 +60,7 @@ describe Projects::RawController do
execute_raw_requests(requests: 6, project: project, file_path: file_path)
expect(flash[:alert]).to eq('You cannot access the raw file. Please wait a minute.')
- expect(response).to redirect_to(project_blob_path(project, file_path))
+ expect(response).to have_gitlab_http_status(429)
end
it 'logs the event on auth.log' do
@@ -92,7 +92,7 @@ describe Projects::RawController do
execute_raw_requests(requests: 3, project: project, file_path: modified_path)
expect(flash[:alert]).to eq('You cannot access the raw file. Please wait a minute.')
- expect(response).to redirect_to(project_blob_path(project, modified_path))
+ expect(response).to have_gitlab_http_status(429)
end
end
@@ -120,7 +120,7 @@ describe Projects::RawController do
execute_raw_requests(requests: 6, project: project, file_path: file_path)
expect(flash[:alert]).to eq('You cannot access the raw file. Please wait a minute.')
- expect(response).to redirect_to(project_blob_path(project, file_path))
+ expect(response).to have_gitlab_http_status(429)
# Accessing upcase version of readme
file_path = "#{commit_sha}/README.md"