Welcome to mirror list, hosted at ThFree Co, Russian Federation.

active_support_subscriber_spec.rb « query_limiting « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b49bc5c328ccdd671c0057a0f859b2ecd1548c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'spec_helper'

describe Gitlab::QueryLimiting::ActiveSupportSubscriber do
  describe '#sql' do
    it 'increments the number of executed SQL queries' do
      transaction = double(:transaction)

      allow(Gitlab::QueryLimiting::Transaction)
        .to receive(:current)
        .and_return(transaction)

      expect(transaction)
        .to receive(:increment)
        .at_least(:once)

      User.count
    end
  end
end