summaryrefslogtreecommitdiff
path: root/spec/models/design_management
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-26 06:09:56 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-26 06:09:56 +0000
commitf88f72df028c02be399ecf3d32c7cf0d8404784f (patch)
tree1a9a607f7a7915302a6f6ec296760279a2d0bb09 /spec/models/design_management
parentc2d7378a6896085f1f2d27c95455fc9728881e60 (diff)
downloadgitlab-ce-f88f72df028c02be399ecf3d32c7cf0d8404784f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/design_management')
-rw-r--r--spec/models/design_management/action_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/design_management/action_spec.rb b/spec/models/design_management/action_spec.rb
index 0a8bbc8d26e..f2b8fcaa256 100644
--- a/spec/models/design_management/action_spec.rb
+++ b/spec/models/design_management/action_spec.rb
@@ -49,6 +49,15 @@ RSpec.describe DesignManagement::Action do
end
end
+ describe '.with_version' do
+ it 'preloads the version' do
+ actions = described_class.with_version
+
+ expect { actions.map(&:version) }.not_to exceed_query_limit(2)
+ expect(actions.count).to be > 2
+ end
+ end
+
describe '.by_event' do
it 'returns the actions by event type' do
expect(described_class.by_event(:deletion)).to match_array([action_a_2, action_c])