summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/raw_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-23 12:08:18 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-23 12:08:18 +0000
commit4aeb8a02c506eaa8f0710ee17edd9e35dd68d280 (patch)
tree42a0ab818ee72a5f99d017f7ca05b6b6349e142a /spec/controllers/projects/raw_controller_spec.rb
parentb8bb2148c282f5ebaf5cd3c83d905285902a1446 (diff)
downloadgitlab-ce-4aeb8a02c506eaa8f0710ee17edd9e35dd68d280.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects/raw_controller_spec.rb')
-rw-r--r--spec/controllers/projects/raw_controller_spec.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/controllers/projects/raw_controller_spec.rb b/spec/controllers/projects/raw_controller_spec.rb
index bdf1c1a84d3..a570db12d94 100644
--- a/spec/controllers/projects/raw_controller_spec.rb
+++ b/spec/controllers/projects/raw_controller_spec.rb
@@ -56,10 +56,13 @@ describe Projects::RawController do
stub_application_setting(raw_blob_request_limit: 5)
end
- it 'prevents from accessing the raw file' do
- execute_raw_requests(requests: 6, project: project, file_path: file_path)
+ it 'prevents from accessing the raw file', :request_store do
+ execute_raw_requests(requests: 5, project: project, file_path: file_path)
+
+ expect { execute_raw_requests(requests: 1, project: project, file_path: file_path) }
+ .to change { Gitlab::GitalyClient.get_request_count }.by(0)
- expect(flash[:alert]).to eq(_('You cannot access the raw file. Please wait a minute.'))
+ expect(response.body).to eq(_('You cannot access the raw file. Please wait a minute.'))
expect(response).to have_gitlab_http_status(429)
end
@@ -109,7 +112,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.body).to eq(_('You cannot access the raw file. Please wait a minute.'))
expect(response).to have_gitlab_http_status(429)
end
end
@@ -137,7 +140,7 @@ describe Projects::RawController do
# Accessing downcase version of readme
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.body).to eq(_('You cannot access the raw file. Please wait a minute.'))
expect(response).to have_gitlab_http_status(429)
# Accessing upcase version of readme