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:
Diffstat (limited to 'spec/models/design_management/action_spec.rb')
-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])