From 2a12eb346ee313199b331db49901e58bc566dabc Mon Sep 17 00:00:00 2001
From: Cam Saul <cammsaul@gmail.com>
Date: Mon, 19 Mar 2018 16:32:04 -0700
Subject: [PATCH] Test fixes :wrench: [ci drivers]

---
 src/metabase/api/embed.clj             |  4 ++++
 src/metabase/api/public.clj            |  4 ++++
 test/metabase/driver/mongo_test.clj    | 12 ++++++------
 test/metabase/query_processor_test.clj |  5 ++---
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/metabase/api/embed.clj b/src/metabase/api/embed.clj
index c96ced34d88..7ca413b4ea1 100644
--- a/src/metabase/api/embed.clj
+++ b/src/metabase/api/embed.clj
@@ -393,6 +393,8 @@
 ;;; --------------------------------------------------- Remappings ---------------------------------------------------
 
 (api/defendpoint GET "/card/:token/field/:field-id/remapping/:remapped-id"
+  "Fetch remapped Field values. This is the same as `GET /api/field/:id/remapping/:remapped-id`, but for use with
+  embedded Cards."
   [token field-id remapped-id value]
   {value su/NonBlankString}
   (let [unsigned-token (eu/unsign token)
@@ -401,6 +403,8 @@
     (public-api/card-field-remapped-values card-id field-id remapped-id value)))
 
 (api/defendpoint GET "/dashboard/:token/field/:field-id/remapping/:remapped-id"
+  "Fetch remapped Field values. This is the same as `GET /api/field/:id/remapping/:remapped-id`, but for use with
+  embedded Dashboards."
   [token field-id remapped-id value]
   {value su/NonBlankString}
   (let [unsigned-token (eu/unsign token)
diff --git a/src/metabase/api/public.clj b/src/metabase/api/public.clj
index 3d665bdb476..f31a4063ee2 100644
--- a/src/metabase/api/public.clj
+++ b/src/metabase/api/public.clj
@@ -326,6 +326,8 @@
   (field-remapped-values field-id remapped-field-id value-str))
 
 (api/defendpoint GET "/card/:uuid/field/:field-id/remapping/:remapped-id"
+  "Fetch remapped Field values. This is the same as `GET /api/field/:id/remapping/:remapped-id`, but for use with public
+  Cards."
   [uuid field-id remapped-id value]
   {value su/NonBlankString}
   (api/check-public-sharing-enabled)
@@ -333,6 +335,8 @@
     (card-field-remapped-values card-id field-id remapped-id value)))
 
 (api/defendpoint GET "/dashboard/:uuid/field/:field-id/remapping/:remapped-id"
+  "Fetch remapped Field values. This is the same as `GET /api/field/:id/remapping/:remapped-id`, but for use with public
+  Dashboards."
   [uuid field-id remapped-id value]
   {value su/NonBlankString}
   (api/check-public-sharing-enabled)
diff --git a/test/metabase/driver/mongo_test.clj b/test/metabase/driver/mongo_test.clj
index 16a88f404fe..4a346543db6 100644
--- a/test/metabase/driver/mongo_test.clj
+++ b/test/metabase/driver/mongo_test.clj
@@ -141,11 +141,11 @@
 
 ;; Test that Tables got synced correctly, and row counts are correct
 (datasets/expect-with-engine :mongo
-  [{:rows 75,   :active true, :name "categories"}
-   {:rows 1000, :active true, :name "checkins"}
-   {:rows 15,   :active true, :name "users"}
-   {:rows 100,  :active true, :name "venues"}]
-  (for [field (db/select [Table :name :active :rows]
+  [{:active true, :name "categories"}
+   {:active true, :name "checkins"}
+   {:active true, :name "users"}
+   {:active true, :name "venues"}]
+  (for [field (db/select [Table :name :active]
                 :db_id (data/id)
                 {:order-by [:name]})]
     (into {} field)))
@@ -157,7 +157,7 @@
    [{:special_type :type/PK,        :base_type :type/Integer,  :name "_id"}
     {:special_type nil,             :base_type :type/DateTime, :name "date"}
     {:special_type :type/Category,  :base_type :type/Integer,  :name "user_id"}
-    {:special_type :type/Category,  :base_type :type/Integer,  :name "venue_id"}]
+    {:special_type nil,             :base_type :type/Integer,  :name "venue_id"}]
    [{:special_type :type/PK,        :base_type :type/Integer,  :name "_id"}
     {:special_type nil,             :base_type :type/DateTime, :name "last_login"}
     {:special_type :type/Name,      :base_type :type/Text,     :name "name"}
diff --git a/test/metabase/query_processor_test.clj b/test/metabase/query_processor_test.clj
index cf5ed299b62..ee65f606d42 100644
--- a/test/metabase/query_processor_test.clj
+++ b/test/metabase/query_processor_test.clj
@@ -230,9 +230,8 @@
                                 {:target_table_id (data/id :venues)}
                                 {})
                 :target       (target-field (venues-col :id))
-                :special_type (if (data/fks-supported?)
-                                :type/FK
-                                :type/Category)
+                :special_type (when (data/fks-supported?)
+                                :type/FK)
                 :base_type    (data/expected-base-type->actual :type/Integer)
                 :name         (data/format-name "venue_id")
                 :display_name "Venue ID"
-- 
GitLab