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
dc856eef
Commit
dc856eef
authored
Feb 07, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce stub_ee_application_setting
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
b42994d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
3 deletions
+23
-3
features/steps/project/elastic/global_search.rb
features/steps/project/elastic/global_search.rb
+1
-1
spec/ee/support/stub_configuration.rb
spec/ee/support/stub_configuration.rb
+16
-0
spec/elastic_integration/global_search_spec.rb
spec/elastic_integration/global_search_spec.rb
+2
-2
spec/support/stub_configuration.rb
spec/support/stub_configuration.rb
+4
-0
No files found.
features/steps/project/elastic/global_search.rb
View file @
dc856eef
require
Rails
.
root
.
join
(
'spec'
,
'support'
,
'stub_configuration'
)
require
_dependency
Rails
.
root
.
join
(
'spec'
,
'support'
,
'stub_configuration'
)
class
Spinach::Features::GlobalSearch
<
Spinach
::
FeatureSteps
include
SharedAuthentication
...
...
spec/ee/support/stub_configuration.rb
0 → 100644
View file @
dc856eef
module
EE
module
StubConfiguration
def
stub_ee_application_setting
(
messages
)
add_predicates
(
messages
)
# Stubbing both of these because we're not yet consistent with how we access
# current application settings
allow_any_instance_of
(
EE
::
ApplicationSetting
).
to
receive_messages
(
to_settings
(
messages
))
allow
(
::
Gitlab
::
CurrentSettings
.
current_application_settings
)
.
to
receive_messages
(
to_settings
(
messages
))
# Ensure that we don't use the Markdown cache when stubbing these values
allow_any_instance_of
(
EE
::
ApplicationSetting
).
to
receive
(
:cached_html_up_to_date?
).
and_return
(
false
)
end
end
end
spec/elastic_integration/global_search_spec.rb
View file @
dc856eef
...
...
@@ -11,7 +11,7 @@ describe 'GlobalSearch' do
let
(
:guest
)
{
create
:user
}
before
do
stub_application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
stub_
ee_
application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
Gitlab
::
Elastic
::
Helper
.
create_empty_index
project
.
add_developer
(
member
)
...
...
@@ -21,7 +21,7 @@ describe 'GlobalSearch' do
after
do
Gitlab
::
Elastic
::
Helper
.
delete_index
stub_application_setting
(
elasticsearch_search:
false
,
elasticsearch_indexing:
false
)
stub_
ee_
application_setting
(
elasticsearch_search:
false
,
elasticsearch_indexing:
false
)
end
context
"Respect feature visibility levels"
do
...
...
spec/support/stub_configuration.rb
View file @
dc856eef
require_dependency
Rails
.
root
.
join
(
'spec'
,
'ee'
,
'support'
,
'stub_configuration'
)
module
StubConfiguration
prepend
EE
::
StubConfiguration
def
stub_application_setting
(
messages
)
add_predicates
(
messages
)
...
...
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