From 7801d133b6c33917a3a151c7a8db5243b148a487 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 12 Nov 2019 09:06:14 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/lib/api/helpers_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec/lib/api') diff --git a/spec/lib/api/helpers_spec.rb b/spec/lib/api/helpers_spec.rb index 0624c25e734..81c4563feb6 100644 --- a/spec/lib/api/helpers_spec.rb +++ b/spec/lib/api/helpers_spec.rb @@ -174,4 +174,18 @@ describe API::Helpers do end end end + + describe '#track_event' do + it "creates a gitlab tracking event" do + expect(Gitlab::Tracking).to receive(:event).with('foo', 'my_event', {}) + + subject.track_event('my_event', category: 'foo') + end + + it "logs an exception" do + expect(Rails.logger).to receive(:warn).with(/Tracking event failed/) + + subject.track_event('my_event', category: nil) + end + end end -- cgit v1.2.1