diff --git a/test/controllers/v1/search_controller_test.rb b/test/controllers/v1/search_controller_test.rb index 8814eb8d694252176483d08b76c88840403a2480..f08da5c0657dfa5b8a44a0cbb649111d5b2b605c 100644 --- a/test/controllers/v1/search_controller_test.rb +++ b/test/controllers/v1/search_controller_test.rb @@ -4,8 +4,7 @@ class V1::SearchControllerTest < ActionController::TestCase tests V1::SearchController setup do - LearningObject.reindex - LearningObject.searchkick_index.refresh + SearchService::SEARCH_CLASSES.each {|search_class| reindex search_class.constantize} auth_application end @@ -26,4 +25,11 @@ class V1::SearchControllerTest < ActionController::TestCase assert_response :bad_request end + private + + def reindex(klass) + klass.reindex + klass.searchkick_index.refresh + end + end