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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f266ec21
Commit
f266ec21
authored
May 24, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
May 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix leaky constant in admin mode migration spec
parent
9ed1e151
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
.rubocop.yml
.rubocop.yml
+0
-1
changelogs/unreleased/leaky-constant-fix-22.yml
changelogs/unreleased/leaky-constant-fix-22.yml
+5
-0
spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb
...ions/20191125114345_add_admin_mode_protected_path_spec.rb
+4
-5
No files found.
.rubocop.yml
View file @
f266ec21
...
@@ -355,7 +355,6 @@ RSpec/LeakyConstantDeclaration:
...
@@ -355,7 +355,6 @@ RSpec/LeakyConstantDeclaration:
-
'
spec/lib/gitlab/quick_actions/dsl_spec.rb'
-
'
spec/lib/gitlab/quick_actions/dsl_spec.rb'
-
'
spec/lib/marginalia_spec.rb'
-
'
spec/lib/marginalia_spec.rb'
-
'
spec/mailers/notify_spec.rb'
-
'
spec/mailers/notify_spec.rb'
-
'
spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb'
-
'
spec/models/concerns/batch_destroy_dependent_associations_spec.rb'
-
'
spec/models/concerns/batch_destroy_dependent_associations_spec.rb'
-
'
spec/models/concerns/bulk_insert_safe_spec.rb'
-
'
spec/models/concerns/bulk_insert_safe_spec.rb'
-
'
spec/models/concerns/bulk_insertable_associations_spec.rb'
-
'
spec/models/concerns/bulk_insertable_associations_spec.rb'
...
...
changelogs/unreleased/leaky-constant-fix-22.yml
0 → 100644
View file @
f266ec21
---
title
:
Fix leaky constant issue in admin mode migration spec
merge_request
:
32074
author
:
Rajendra Kadam
type
:
fixed
spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb
View file @
f266ec21
...
@@ -4,10 +4,9 @@ require 'spec_helper'
...
@@ -4,10 +4,9 @@ require 'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'migrate'
,
'20191125114345_add_admin_mode_protected_path.rb'
)
require
Rails
.
root
.
join
(
'db'
,
'migrate'
,
'20191125114345_add_admin_mode_protected_path.rb'
)
describe
AddAdminModeProtectedPath
do
describe
AddAdminModeProtectedPath
do
ADMIN_MODE_ENDPOINT
=
'/admin/session'
subject
(
:migration
)
{
described_class
.
new
}
subject
(
:migration
)
{
described_class
.
new
}
let
(
:admin_mode_endpoint
)
{
'/admin/session'
}
let
(
:application_settings
)
{
table
(
:application_settings
)
}
let
(
:application_settings
)
{
table
(
:application_settings
)
}
context
'no settings available'
do
context
'no settings available'
do
...
@@ -30,7 +29,7 @@ describe AddAdminModeProtectedPath do
...
@@ -30,7 +29,7 @@ describe AddAdminModeProtectedPath do
application_settings
.
create!
(
protected_paths:
'{a,b,c}'
)
application_settings
.
create!
(
protected_paths:
'{a,b,c}'
)
protected_paths_before
=
%w[a b c]
protected_paths_before
=
%w[a b c]
protected_paths_after
=
protected_paths_before
.
dup
<<
ADMIN_MODE_ENDPOINT
protected_paths_after
=
protected_paths_before
.
dup
<<
admin_mode_endpoint
expect
{
migrate!
}.
to
change
{
application_settings
.
first
.
protected_paths
}.
from
(
protected_paths_before
).
to
(
protected_paths_after
)
expect
{
migrate!
}.
to
change
{
application_settings
.
first
.
protected_paths
}.
from
(
protected_paths_before
).
to
(
protected_paths_after
)
end
end
...
@@ -38,13 +37,13 @@ describe AddAdminModeProtectedPath do
...
@@ -38,13 +37,13 @@ describe AddAdminModeProtectedPath do
it
'new default includes admin mode endpoint'
do
it
'new default includes admin mode endpoint'
do
settings_before
=
application_settings
.
create!
settings_before
=
application_settings
.
create!
expect
(
settings_before
.
protected_paths
).
not_to
include
(
ADMIN_MODE_ENDPOINT
)
expect
(
settings_before
.
protected_paths
).
not_to
include
(
admin_mode_endpoint
)
migrate!
migrate!
application_settings
.
reset_column_information
application_settings
.
reset_column_information
settings_after
=
application_settings
.
create!
settings_after
=
application_settings
.
create!
expect
(
settings_after
.
protected_paths
).
to
include
(
ADMIN_MODE_ENDPOINT
)
expect
(
settings_after
.
protected_paths
).
to
include
(
admin_mode_endpoint
)
end
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