Skip to content
Snippets Groups Projects
Unverified Commit 50230275 authored by Ryan Senior's avatar Ryan Senior Committed by GitHub
Browse files

Merge pull request #6399 from metabase/i18n-enable-defsetting

Relax defsetting precondition for descriptions
parents fc1f41db fb9dc284
No related branches found
No related tags found
No related merge requests found
......@@ -378,7 +378,7 @@
clear the values of the Setting.)"
{:style/indent 1}
[setting-symb description & {:as options}]
{:pre [(symbol? setting-symb) (string? description)]}
{:pre [(symbol? setting-symb)]}
`(let [setting# (register-setting! (assoc ~options
:name ~(keyword setting-symb)
:description ~description))]
......
......@@ -2,6 +2,7 @@
(:require [expectations :refer :all]
[metabase.models.setting :as setting :refer [defsetting Setting]]
[metabase.test.util :refer :all]
[puppetlabs.i18n.core :refer [tru]]
[toucan.db :as db]))
;; ## TEST SETTINGS DEFINITIONS
......@@ -16,11 +17,11 @@
"Test setting - this only shows up in dev (2)"
:default "[Default Value]")
(defsetting test-boolean-setting
(defsetting ^:private test-boolean-setting
"Test setting - this only shows up in dev (3)"
:type :boolean)
(defsetting test-json-setting
(defsetting ^:private test-json-setting
"Test setting - this only shows up in dev (4)"
:type :json)
......@@ -181,6 +182,16 @@
:when (re-find #"^test-setting-\d$" (name (:key setting)))]
setting)))
(defsetting ^:private test-i18n-setting
(tru "Test setting - with i18n"))
;; Validate setting description with i18n string
(expect
["Test setting - with i18n"]
(for [{:keys [key description]} (setting/all)
:when (= :test-i18n-setting key)]
description))
;;; ------------------------------------------------------------ BOOLEAN SETTINGS ------------------------------------------------------------
......
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