diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2019-07-29 12:58:58 +0300 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2019-07-29 12:58:58 +0300 |
commit | 26e9efc011c49b6918d4cc345a3328cabf22e2a7 (patch) | |
tree | 15076bcd7636cc4efc1421853245196a12fc2bdc /spec/lib/gitlab/usage_data_counters | |
parent | 77926ea02512d836c61a30e3986902e2d8e7f886 (diff) |
Added navbar searches usage ping counter
Added usage ping counter when the user makes
a search through the navbar search component.
Diffstat (limited to 'spec/lib/gitlab/usage_data_counters')
-rw-r--r-- | spec/lib/gitlab/usage_data_counters/search_counter_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/gitlab/usage_data_counters/search_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/search_counter_spec.rb new file mode 100644 index 00000000000..50a9f980dc7 --- /dev/null +++ b/spec/lib/gitlab/usage_data_counters/search_counter_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Gitlab::UsageDataCounters::SearchCounter, :clean_gitlab_redis_shared_state do + it 'increments counter and return the total count' do + expect(described_class.total_navbar_searches_count).to eq(0) + + 2.times { described_class.increment_navbar_searches_count } + + expect(described_class.total_navbar_searches_count).to eq(2) + end +end |