Move chewy enable for spec to search data manager (#38054)
This commit is contained in:
@@ -57,8 +57,6 @@ Sidekiq.default_configuration.logger = nil
|
|||||||
|
|
||||||
DatabaseCleaner.strategy = [:deletion]
|
DatabaseCleaner.strategy = [:deletion]
|
||||||
|
|
||||||
Chewy.settings[:enabled] = false
|
|
||||||
|
|
||||||
Devise::Test::ControllerHelpers.module_eval do
|
Devise::Test::ControllerHelpers.module_eval do
|
||||||
alias_method :original_sign_in, :sign_in
|
alias_method :original_sign_in, :sign_in
|
||||||
|
|
||||||
|
|||||||
@@ -45,11 +45,14 @@ end
|
|||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
config.before :suite do
|
config.before :suite do
|
||||||
if search_examples_present?
|
if search_examples_present?
|
||||||
|
Chewy.settings[:enabled] = true
|
||||||
# Configure chewy to use `urgent` strategy to index documents
|
# Configure chewy to use `urgent` strategy to index documents
|
||||||
Chewy.strategy(:urgent)
|
Chewy.strategy(:urgent)
|
||||||
|
|
||||||
# Create search data
|
# Create search data
|
||||||
search_data_manager.prepare_test_data
|
search_data_manager.prepare_test_data
|
||||||
|
else
|
||||||
|
Chewy.settings[:enabled] = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user