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:
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