Commit b868f90d authored by James Lopez's avatar James Lopez

update spec

parent b00b2493
......@@ -9,7 +9,7 @@ module Gitlab
def log
return unless ::License.feature_available?(:ide)
::Gitlab::AppLogger.info({test: 1})
Rails.logger.info("Web editor usage - #{metric_info}")
end
......
......@@ -6,19 +6,25 @@ describe Gitlab::Metrics::MultiFileEditor do
subject { described_class.new(project, user, project.commit('b83d6e391c22777fca1ed3012fce84f633d7fed0')) }
before do
stub_licensed_features(ide: true)
end
describe '.record' do
describe 'metrics' do
it 'has the right log info' do
stub_licensed_features(ide: true)
info = "Web editor usage - ide_usage_project_id: #{project.id}, ide_usage_user: #{user.id}, ide_usage_line_count: 1, ide_usage_file_count: 1"
expect(Rails.logger).to receive(:info).with(info)
subject.log
end
it 'does not log any info if IDE is disabled' do
info = "Web editor usage - ide_usage_project_id: #{project.id}, ide_usage_user: #{user.id}, ide_usage_line_count: 1, ide_usage_file_count: 1"
expect(Rails.logger).not_to receive(:info).with(info)
subject.log
end
end
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