diff options
author | Mark Fletcher <mark@gitlab.com> | 2017-05-01 17:42:42 +0800 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2017-05-03 18:45:19 +0800 |
commit | 21f5515a5ffb46bb2e710c17690122903bca126e (patch) | |
tree | 64e75fdfd749195d2f6b3fb9fb42572ab88b6a4a /spec/requests/api/projects_spec.rb | |
parent | 3aca8b6557a638e0634065a1c72d87861b9ace4a (diff) | |
download | gitlab-ce-21f5515a5ffb46bb2e710c17690122903bca126e.tar.gz |
Expose project statistics on single requests via the API
+ The statistics parameter was already accepted
* This commit ensure that it is respected for GET /projects/:id endpoint
+ Add documentation of the parameter and update the example response for stats
Diffstat (limited to 'spec/requests/api/projects_spec.rb')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index cc03d7a933b..ab70ce5cd2f 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -665,6 +665,20 @@ describe API::Projects do }) end + it "does not include statistics by default" do + get api("/projects/#{project.id}", user) + + expect(response).to have_http_status(200) + expect(json_response).not_to include 'statistics' + end + + it "includes statistics if requested" do + get api("/projects/#{project.id}", user), statistics: true + + expect(response).to have_http_status(200) + expect(json_response).to include 'statistics' + end + describe 'permissions' do context 'all projects' do before { project.team << [user, :master] } |