From 81d41c0f927f69d75937d3c8f757740e936ed6e9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 2 Jul 2014 12:40:20 +0300 Subject: Collect contributors info via API --- spec/requests/api/repositories_spec.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'spec/requests/api/repositories_spec.rb') diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb index 94850d0f1ae..daf534d7317 100644 --- a/spec/requests/api/repositories_spec.rb +++ b/spec/requests/api/repositories_spec.rb @@ -128,7 +128,7 @@ describe API::API, api: true do end end - describe 'GET /GET /projects/:id/repository/compare' do + describe 'GET /projects/:id/repository/compare' do it "should compare branches" do get api("/projects/#{project.id}/repository/compare", user), from: 'master', to: 'simple_merge_request' response.status.should == 200 @@ -166,4 +166,17 @@ describe API::API, api: true do json_response['compare_same_ref'].should be_true end end + + describe 'GET /projects/:id/repository/contributors' do + it 'should return valid data' do + get api("/projects/#{project.id}/repository/contributors", user) + response.status.should == 200 + contributor = json_response.values.first + contributor['email'].should == 'dmitriy.zaporozhets@gmail.com' + contributor['name'].should == 'Dmitriy Zaporozhets' + contributor['commits'].should == 185 + contributor['additions'].should == 66072 + contributor['deletions'].should == 63013 + end + end end -- cgit v1.2.1