diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-23 21:06:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-23 21:06:14 +0300 |
commit | c792263edfaf826c58f4aa41d26904464a17a3e7 (patch) | |
tree | b57ae96c9eeaf0a1432a29f7f50f2fce9529818d /spec/lib/gitlab/usage_data_spec.rb | |
parent | 6f9edd1a4c4942d3d13ec54793cfae56164b1a0a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/usage_data_spec.rb')
-rw-r--r-- | spec/lib/gitlab/usage_data_spec.rb | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index 842dc4d511c..e09390a0047 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -64,31 +64,29 @@ describe Gitlab::UsageData do avg_cycle_analytics influxdb_metrics_enabled prometheus_metrics_enabled - cycle_analytics_views - productivity_analytics_views )) - - expect(subject).to include( - snippet_create: a_kind_of(Integer), - snippet_update: a_kind_of(Integer), - snippet_comment: a_kind_of(Integer), - merge_request_comment: a_kind_of(Integer), - merge_request_create: a_kind_of(Integer), - commit_comment: a_kind_of(Integer), - wiki_pages_create: a_kind_of(Integer), - wiki_pages_update: a_kind_of(Integer), - wiki_pages_delete: a_kind_of(Integer), - web_ide_views: a_kind_of(Integer), - web_ide_commits: a_kind_of(Integer), - web_ide_merge_requests: a_kind_of(Integer), - navbar_searches: a_kind_of(Integer), - cycle_analytics_views: a_kind_of(Integer), - productivity_analytics_views: a_kind_of(Integer), - source_code_pushes: a_kind_of(Integer) - ) end it 'gathers usage counts' do + smau_keys = %i( + snippet_create + snippet_update + snippet_comment + merge_request_comment + merge_request_create + commit_comment + wiki_pages_create + wiki_pages_update + wiki_pages_delete + web_ide_views + web_ide_commits + web_ide_merge_requests + navbar_searches + cycle_analytics_views + productivity_analytics_views + source_code_pushes + ) + expected_keys = %i( assignee_lists boards @@ -154,12 +152,13 @@ describe Gitlab::UsageData do uploads web_hooks user_preferences - ) + ).push(*smau_keys) count_data = subject[:counts] expect(count_data[:boards]).to eq(1) expect(count_data[:projects]).to eq(4) + expect(count_data.values_at(*smau_keys)).to all(be_an(Integer)) expect(count_data.keys).to include(*expected_keys) expect(expected_keys - count_data.keys).to be_empty end |