diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-18 03:09:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-18 03:09:20 +0300 |
commit | 72721699f11187199e89631ce0b5e3d2f7c167e9 (patch) | |
tree | b51a227be89d82aa24fc954e7b50e7b0933583cc /spec/requests/api/commits_spec.rb | |
parent | 06be418a7cd98a1c87c41ba43cca1ce9acbe885e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/commits_spec.rb')
-rw-r--r-- | spec/requests/api/commits_spec.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb index 170b9ccccf8..c179de249d5 100644 --- a/spec/requests/api/commits_spec.rb +++ b/spec/requests/api/commits_spec.rb @@ -266,8 +266,30 @@ describe API::Commits do end end - context 'set to blank' do - let(:order) { '' } + context 'set to default' do + let(:order) { 'default' } + + # git log --graph -n 6 --pretty=format:"%h" --date-order 0031876 + # * 0031876 + # |\ + # * | bf6e164 + # | * 48ca272 + # * | 9d526f8 + # | * 335bc94 + # |/ + # * 1039376 + it 'returns project commits ordered by default order' do + commits = project.repository.commits("0031876", limit: 6, order: 'default') + + get api(route, current_user) + + expect(json_response.size).to eq(6) + expect(json_response.map { |entry| entry["id"] }).to eq(commits.map(&:id)) + end + end + + context 'set to an invalid parameter' do + let(:order) { 'invalid' } it_behaves_like '400 response' do let(:request) { get api(route, current_user) } |