Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
bef905a9
Commit
bef905a9
authored
Nov 15, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport EE changes
parent
90801a43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
spec/db/schema_spec.rb
spec/db/schema_spec.rb
+7
-1
No files found.
spec/db/schema_spec.rb
View file @
bef905a9
...
@@ -78,7 +78,7 @@ describe 'Database schema' do
...
@@ -78,7 +78,7 @@ describe 'Database schema' do
let
(
:column_names
)
{
columns
.
map
(
&
:name
)
}
let
(
:column_names
)
{
columns
.
map
(
&
:name
)
}
let
(
:column_names_with_id
)
{
column_names
.
select
{
|
column_name
|
column_name
.
ends_with?
(
'_id'
)
}
}
let
(
:column_names_with_id
)
{
column_names
.
select
{
|
column_name
|
column_name
.
ends_with?
(
'_id'
)
}
}
let
(
:foreign_keys_columns
)
{
foreign_keys
.
map
(
&
:column
)
}
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
it
'do have the foreign keys'
do
expect
(
column_names_with_id
-
ignored_columns
).
to
contain_exactly
(
*
foreign_keys_columns
)
expect
(
column_names_with_id
-
ignored_columns
).
to
contain_exactly
(
*
foreign_keys_columns
)
...
@@ -87,4 +87,10 @@ describe 'Database schema' do
...
@@ -87,4 +87,10 @@ describe 'Database schema' do
end
end
end
end
end
end
private
def
ignored_fk_columns
(
column
)
IGNORED_FK_COLUMNS
.
fetch
(
column
,
[])
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment