diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-12 12:06:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-12 12:06:14 +0300 |
commit | 7801d133b6c33917a3a151c7a8db5243b148a487 (patch) | |
tree | 7a8fbb7dd66875acd0adb490dc91aa91c0802987 /spec/lib/api | |
parent | 60877d1bff65fa4d2b74409d343d5b7615478891 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/api')
-rw-r--r-- | spec/lib/api/helpers_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
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 |