diff options
author | Adam Hegyi <ahegyi@gitlab.com> | 2019-08-14 16:12:12 +0000 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2019-08-14 16:12:12 +0000 |
commit | c5cb5da4ac4b414fb0d46412f80a686130a69e19 (patch) | |
tree | e8ab44f4cb0e0e265f756f93e267ce12041b8e8d /spec/controllers | |
parent | 25f8e99a21ae1357403d1c2b96037b3cc80f254a (diff) | |
download | gitlab-ce-c5cb5da4ac4b414fb0d46412f80a686130a69e19.tar.gz |
Track page views for cycle analytics show page
This change adds a new counter 'cycle_analytics_views' to the usage data
metrics to count the page views for cycle analytics show page.
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/cycle_analytics_controller_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/projects/cycle_analytics_controller_spec.rb b/spec/controllers/projects/cycle_analytics_controller_spec.rb index 2dc97e18113..5e6ceef2517 100644 --- a/spec/controllers/projects/cycle_analytics_controller_spec.rb +++ b/spec/controllers/projects/cycle_analytics_controller_spec.rb @@ -11,6 +11,20 @@ describe Projects::CycleAnalyticsController do project.add_maintainer(user) end + context "counting page views for 'show'" do + it 'increases the counter' do + expect(Gitlab::UsageDataCounters::CycleAnalyticsCounter).to receive(:count).with(:views) + + get(:show, + params: { + namespace_id: project.namespace, + project_id: project + }) + + expect(response).to be_success + end + end + describe 'cycle analytics not set up flag' do context 'with no data' do it 'is true' do |