From c65564430782ad4503376fd6378e77107e52f582 Mon Sep 17 00:00:00 2001
From: Mauricio Giacomini Girardello <mgg12@inf.ufpr.br>
Date: Mon, 30 May 2016 11:45:58 -0300
Subject: [PATCH] fixing searchkiq index

---
 test/controllers/v1/search_controller_test.rb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/test/controllers/v1/search_controller_test.rb b/test/controllers/v1/search_controller_test.rb
index 8814eb8d..f08da5c0 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
-- 
GitLab