summaryrefslogtreecommitdiff
path: root/spec/requests/api/commits_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/commits_spec.rb')
-rw-r--r--spec/requests/api/commits_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb
index 5e6ff40e8cf..90ff1d12bf1 100644
--- a/spec/requests/api/commits_spec.rb
+++ b/spec/requests/api/commits_spec.rb
@@ -169,6 +169,18 @@ describe API::Commits do
end
end
+ context 'first_parent optional parameter' do
+ it 'returns all first_parent commits' do
+ commit_count = project.repository.count_commits(ref: SeedRepo::Commit::ID, first_parent: true)
+
+ get api("/projects/#{project_id}/repository/commits", user), params: { ref_name: SeedRepo::Commit::ID, first_parent: 'true' }
+
+ expect(response).to include_pagination_headers
+ expect(commit_count).to eq(12)
+ expect(response.headers['X-Total']).to eq(commit_count.to_s)
+ end
+ end
+
context 'with_stats optional parameter' do
let(:project) { create(:project, :public, :repository) }