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
path: root/spec/db
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-11-15 14:57:13 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-11-15 14:57:13 +0300
commitbef905a90965f491e9f2390af45c749902cd6098 (patch)
tree7c53191229f2f3f1bbf389433b796e8725b83a60 /spec/db
parent90801a43ca69462d7cd39e64c2eee6e871c03111 (diff)
Backport EE changes
Diffstat (limited to 'spec/db')
-rw-r--r--spec/db/schema_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb
index 43e23ee389e..e8584846b56 100644
--- a/spec/db/schema_spec.rb
+++ b/spec/db/schema_spec.rb
@@ -78,7 +78,7 @@ describe 'Database schema' do
let(:column_names) { columns.map(&:name) }
let(:column_names_with_id) { column_names.select { |column_name| column_name.ends_with?('_id') } }
let(:foreign_keys_columns) { foreign_keys.map(&:column) }
- let(:ignored_columns) { IGNORED_FK_COLUMNS[table] || [] }
+ let(:ignored_columns) { ignored_fk_columns(table) }
it 'do have the foreign keys' do
expect(column_names_with_id - ignored_columns).to contain_exactly(*foreign_keys_columns)
@@ -87,4 +87,10 @@ describe 'Database schema' do
end
end
end
+
+ private
+
+ def ignored_fk_columns(column)
+ IGNORED_FK_COLUMNS.fetch(column, [])
+ end
end