Commit c04e1ce3 authored by James Lopez's avatar James Lopez

add license check

parent 89f62d65
......@@ -10,6 +10,8 @@ module Gitlab
end
def record
return unless ::License.feature_available?(:ide)
::Gitlab::Metrics.counter(
METRIC_NAME,
'Total number of commits using the multi-file web editor',
......
......@@ -24,6 +24,8 @@ describe Gitlab::Metrics::MultiFileEditor do
describe '.record' do
it 'records the right metrics' do
stub_licensed_features(ide: true)
expect(::Gitlab::Metrics).to receive(:counter).with(*params)
subject.record
......
......@@ -246,7 +246,9 @@ describe API::Commits do
end
it 'does not call the metrics using access token authentication' do
post api(url, user), valid_c_params
stub_licensed_features(ide: true)
post api(url, user), valid_c_paramss
expect_any_instance_of(::Gitlab::Metrics::MultiFileEditor).not_to receive(:record)
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