Skip to content
Snippets Groups Projects
Commit 05fe2c82 authored by Cam Saül's avatar Cam Saül
Browse files

Fix getting started guide endpoint if no metrics are defined :wrench:

parent 4ffcc006
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,8 @@
:important_segments segment-ids
;; A map of metric_id -> sequence of important field_ids
:metric_important_fields (m/map-vals (partial map :field_id)
(group-by :metric_id (db/select ['MetricImportantField :field_id :metric_id]
:metric_id [:in metric-ids])))}))
(group-by :metric_id (when (seq metric-ids)
(db/select ['MetricImportantField :field_id :metric_id]
:metric_id [:in metric-ids]))))}))
(define-routes)
(ns metabase.api.getting-started-guide-test
(:require [expectations :refer :all]
[metabase.test.data.users :refer [user->client]]))
;; just make sure the getting started guide endpoint works and returns the correct keys
(expect
#{:metric_important_fields :most_important_dashboard :things_to_know :important_metrics :important_segments :important_tables :contact}
(set (keys ((user->client :rasta) :get 200 "getting_started"))))
(ns metabase.test.data.users
"Code related to creating / managing fake `Users` for testing purposes."
;; TODO - maybe this namespace should just be `metabase.test.users`.
(:require [medley.core :as m]
(metabase [db :as db]
[http-client :as http])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment