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
3bf1cd57
Commit
3bf1cd57
authored
Sep 10, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure in-memory application settings are cleared before each test
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
a5517ada
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
lib/gitlab/current_settings.rb
lib/gitlab/current_settings.rb
+4
-0
spec/spec_helper.rb
spec/spec_helper.rb
+4
-0
No files found.
lib/gitlab/current_settings.rb
View file @
3bf1cd57
...
...
@@ -13,6 +13,10 @@ module Gitlab
Gitlab
::
FakeApplicationSettings
.
new
(
::
ApplicationSetting
.
defaults
.
merge
(
attributes
||
{}))
end
def
clear_in_memory_application_settings!
instance_variable_set
(
:@in_memory_application_settings
,
nil
)
end
def
method_missing
(
name
,
*
args
,
&
block
)
current_application_settings
.
send
(
name
,
*
args
,
&
block
)
# rubocop:disable GitlabSecurity/PublicSend
end
...
...
spec/spec_helper.rb
View file @
3bf1cd57
...
...
@@ -135,6 +135,10 @@ RSpec.configure do |config|
Fog
.
unmock!
if
Fog
.
mock?
end
config
.
after
(
:example
)
do
Gitlab
::
CurrentSettings
.
clear_in_memory_application_settings!
end
config
.
before
(
:example
,
:mailer
)
do
reset_delivered_emails!
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