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

lists_controller_spec.rb « boards « requests « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4d9f1dace4dd471f720b371ea59da13ad9c557e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Boards::ListsController do
  describe '#index' do
    let(:board) { create(:board) }
    let(:user) { board.project.owner }

    it 'does not have N+1 queries' do
      login_as(user)

      # First request has more queries because we create the default `backlog` list
      get board_lists_path(board)

      create(:list, board: board)

      control_count = ActiveRecord::QueryRecorder.new { get board_lists_path(board) }.count

      create_list(:list, 5, board: board)

      expect { get board_lists_path(board) }.not_to exceed_query_limit(control_count)
    end
  end
end