From cda99bf2fd2a6f946ad0b6612546f5ee99d6c691 Mon Sep 17 00:00:00 2001
From: Simon Belak <simon@metabase.com>
Date: Fri, 4 May 2018 00:59:13 +0200
Subject: [PATCH] Update tests for /candidates

---
 .../automagic_dashboards/core_test.clj         | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/test/metabase/automagic_dashboards/core_test.clj b/test/metabase/automagic_dashboards/core_test.clj
index dd955489765..958899fbb09 100644
--- a/test/metabase/automagic_dashboards/core_test.clj
+++ b/test/metabase/automagic_dashboards/core_test.clj
@@ -206,22 +206,20 @@
 
 
 (expect
+  3
+  (with-rasta
+    (->> (Database (data/id)) candidate-tables first :tables count)))
+
+;; /candidates should work with unanalyzed tables
+(expect
+  1
   (tt/with-temp* [Database [{db-id :id}]
                   Table    [{table-id :id} {:db_id db-id}]
                   Field    [{} {:table_id table-id}]
                   Field    [{} {:table_id table-id}]]
     (with-rasta
       (with-dashboard-cleanup
-        (let [database           (Database db-id)
-              not-analyzed-count (count (candidate-tables database))]
-          (db/update! Table table-id :entity_type :entity/GenericTable)
-          (= (inc not-analyzed-count) (count (candidate-tables database))))))))
-
-
-(expect
-  3
-  (with-rasta
-    (->> (Database (data/id)) candidate-tables first :tables count)))
+        (count (candidate-tables (Database db-id)))))))
 
 
 ;; Identity
-- 
GitLab