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

batch_root_storage_statistics_loader_spec.rb « loaders « graphql « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f73eace274dd691893933bda82112cbcddb2ae75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader do
  describe '#find' do
    it 'only queries once for project statistics' do
      stats = create_list(:namespace_root_storage_statistics, 2)
      namespace1 = stats.first.namespace
      namespace2 = stats.last.namespace

      expect do
        described_class.new(namespace1.id).find
        described_class.new(namespace2.id).find
      end.not_to exceed_query_limit(1)
    end
  end
end