diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-08 00:08:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-08 00:08:27 +0300 |
commit | 4df2fd43039fb3f09086525501db071790e1699f (patch) | |
tree | 9af966dc861351d7a7d97dd9f6a586d5700a63d3 /spec/db | |
parent | c2bdb9d02768a61bee7560113f4d4c83dc91338e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/db')
-rw-r--r-- | spec/db/schema_spec.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb index c53610f7d4c..a2941ff2d1a 100644 --- a/spec/db/schema_spec.rb +++ b/spec/db/schema_spec.rb @@ -180,18 +180,16 @@ RSpec.describe 'Database schema' do 'PrometheusAlert' => %w[operator] }.freeze - context 'for enums' do - ApplicationRecord.descendants.each do |model| - # skip model if it is an abstract class as it would not have an associated DB table - next if model.abstract_class? + context 'for enums', :eager_load do + # skip model if it is an abstract class as it would not have an associated DB table + let(:models) { ApplicationRecord.descendants.reject(&:abstract_class?) } - describe model do - let(:ignored_enums) { ignored_limit_enums(model.name) } - let(:enums) { model.defined_enums.keys - ignored_enums } + it 'uses smallint for enums in all models', :aggregate_failures do + models.each do |model| + ignored_enums = ignored_limit_enums(model.name) + enums = model.defined_enums.keys - ignored_enums - it 'uses smallint for enums' do - expect(model).to use_smallint_for_enums(enums) - end + expect(model).to use_smallint_for_enums(enums) end end end |