summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/usage_data_counters/web_ide_counter_spec.rb
blob: fa0cf15e1b2737bd89eb63430290dcd108f1a988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

describe Gitlab::UsageDataCounters::WebIdeCounter, :clean_gitlab_redis_shared_state do
  describe '.increment_commits_count' do
    it 'increments the web ide commits counter by 1' do
      expect do
        described_class.increment_commits_count
      end.to change { described_class.total_commits_count }.by(1)
    end
  end

  describe '.total_commits_count' do
    it 'returns the total amount of web ide commits' do
      2.times { described_class.increment_commits_count }

      expect(described_class.total_commits_count).to eq(2)
    end
  end
end