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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-27 21:06:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-27 21:06:20 +0300
commit2abb1b54c0305b359b178d6660810e865f619c22 (patch)
treee388953a0566ef9844b0b98cdb34236049721a14 /spec/requests/boards
parent8320f7956d72986f5a7c850874fce4f8b5a8e015 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/boards')
-rw-r--r--spec/requests/boards/lists_controller_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/requests/boards/lists_controller_spec.rb b/spec/requests/boards/lists_controller_spec.rb
new file mode 100644
index 00000000000..7451ad93efd
--- /dev/null
+++ b/spec/requests/boards/lists_controller_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+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