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>2023-08-15 12:10:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-08-15 12:10:30 +0300
commitcd5f4619db234c00d0c01ed63bb92df6c10b0fd3 (patch)
tree09ef12a2231c616d4f747b9d5b83597ae179bb06 /spec/rubocop
parent024f77efd68833bb78540ff9b4c7b4ec4b9dfe39 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/rubocop')
-rw-r--r--spec/rubocop/cop/database/avoid_inheritance_column_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/rubocop/cop/database/avoid_inheritance_column_spec.rb b/spec/rubocop/cop/database/avoid_inheritance_column_spec.rb
new file mode 100644
index 00000000000..e009cde8551
--- /dev/null
+++ b/spec/rubocop/cop/database/avoid_inheritance_column_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rubocop_spec_helper'
+require_relative '../../../../rubocop/cop/database/avoid_inheritance_column'
+
+RSpec.describe RuboCop::Cop::Database::AvoidInheritanceColumn, feature_category: :shared do
+ it 'flags when :inheritance_column is used' do
+ src = <<~SRC
+ self.inheritance_column = 'some_column'
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use Single Table Inheritance https://docs.gitlab.com/ee/development/database/single_table_inheritance.html
+ SRC
+
+ expect_offense(src)
+ end
+
+ it 'does not flag when :inheritance_column is set to :_type_disabled' do
+ src = <<~SRC
+ self.inheritance_column = :_type_disabled
+ SRC
+
+ expect_no_offenses(src)
+ end
+end