summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/usage_data_counters/search_counter_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/usage_data_counters/search_counter_spec.rb')
-rw-r--r--spec/lib/gitlab/usage_data_counters/search_counter_spec.rb13
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