diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2019-05-12 16:10:46 -0500 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2019-06-03 12:01:32 +0200 |
commit | 83a8b779615c968af5afe15a1cbc6903d639f265 (patch) | |
tree | fb98c67d6e184ff2b283ad26b82fc9d3316191a4 /spec/models/project_statistics_spec.rb | |
parent | ac03f30cd938cd2c75d05cbc7adbde3f42666ab1 (diff) | |
download | gitlab-ce-83a8b779615c968af5afe15a1cbc6903d639f265.tar.gz |
Add Namespace and ProjectStatistics to GraphQL API
We can query namespaces, and nested projects.
Projects now exposes statistics
Diffstat (limited to 'spec/models/project_statistics_spec.rb')
-rw-r--r-- | spec/models/project_statistics_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index f985c114d4b..358873f9a2f 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -11,6 +11,20 @@ describe ProjectStatistics do it { is_expected.to belong_to(:namespace) } end + describe 'scopes' do + describe '.for_project_ids' do + it 'returns only requested projects' do + stats = create_list(:project_statistics, 3) + project_ids = stats[0..1].map { |s| s.project_id } + expected_ids = stats[0..1].map { |s| s.id } + + requested_stats = described_class.for_project_ids(project_ids).pluck(:id) + + expect(requested_stats).to eq(expected_ids) + end + end + end + describe 'statistics columns' do it "support values up to 8 exabytes" do statistics.update!( |