Commit 89710418 authored by Doug Stull's avatar Doug Stull

Track buy more ci minutes click

- metrics for data analysis
parent adb7969e
......@@ -4,7 +4,12 @@
.pipeline-quota.container-fluid
.row
.col-sm-6.offset-sm-6
= link_to s_('UsageQuota|Buy additional minutes'), EE::SUBSCRIPTIONS_PLANS_URL, target: '_blank', class: 'btn btn-inverted btn-success float-right' if ::Gitlab.com?
- if ::Gitlab.com?
= link_to s_('UsageQuota|Buy additional minutes'),
EE::SUBSCRIPTIONS_PLANS_URL,
target: '_blank',
class: 'btn btn-inverted btn-success float-right',
data: { track_event: 'click_buy_ci_minutes', track_label: namespace.actual_plan_name, track_property: 'pipeline_quota_page' }
.row
.col-sm-6
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe 'Groups > Usage Quotas' do
let(:user) { create(:user) }
let_it_be(:user) { create(:user) }
let(:group) { create(:group) }
let!(:project) { create(:project, namespace: group, shared_runners_enabled: true) }
let(:gitlab_dot_com) { true }
......@@ -126,7 +126,7 @@ describe 'Groups > Usage Quotas' do
end
end
it 'shows correct group quota and projects info' do
it 'has correct tracking setup and shows correct group quota and projects info' do
visit_pipeline_quota_page
expect(page).to have_content('Buy additional minutes')
......@@ -141,6 +141,12 @@ describe 'Groups > Usage Quotas' do
expect(page).to have_content(project.full_name)
expect(page).not_to have_content(other_project.full_name)
end
link = page.find('a', text: 'Buy additional minutes')
expect(link['data-track-event']).to eq('click_buy_ci_minutes')
expect(link['data-track-label']).to eq(group.actual_plan_name)
expect(link['data-track-property']).to eq('pipeline_quota_page')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment