From 4c464055fbcdab02bb8334b148c0e35b981b239e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 5 Nov 2019 15:06:17 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/requests/api/commits_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec/requests/api/commits_spec.rb') diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb index fa24958a79f..9cea4866c4c 100644 --- a/spec/requests/api/commits_spec.rb +++ b/spec/requests/api/commits_spec.rb @@ -1089,6 +1089,20 @@ describe API::Commits do expect(json_response.first.keys).to include 'diff' end + context 'when hard limits are lower than the number of files' do + before do + allow(Commit).to receive(:max_diff_options).and_return(max_files: 1) + end + + it 'respects the limit' do + get api(route, current_user) + + expect(response).to have_gitlab_http_status(200) + expect(response).to include_pagination_headers + expect(json_response.size).to be <= 1 + end + end + context 'when ref does not exist' do let(:commit_id) { 'unknown' } -- cgit v1.2.3