diff --git a/src/formulare/core.clj b/src/formulare/core.clj index d6d94c9..d67ba53 100644 --- a/src/formulare/core.clj +++ b/src/formulare/core.clj @@ -5,9 +5,6 @@ [hiccup.core :as hcore] [ring.util.anti-forgery :refer [anti-forgery-field]])) -(defn in? [coll x] - (some? (some (partial = x) coll))) - (spec/def ::label string?) (spec/def ::required boolean?) (spec/def ::spec @@ -18,8 +15,7 @@ :options (spec/coll-of (spec/tuple string? string?)))) (spec/def ::widget #{:input :select :checkbox :textarea :mselect :hidden}) -(spec/def ::from-req - (spec/and ifn? #_(= 1 (->> % meta :arglists (map count) first)))) +(spec/def ::from-req ifn?) (spec/def ::to-form ::from-req) (spec/def ::field (spec/keys :opt-un [::label diff --git a/test/formulare/theme_test.clj b/test/formulare/theme_test.clj index d4a1e27..3dc8117 100644 --- a/test/formulare/theme_test.clj +++ b/test/formulare/theme_test.clj @@ -51,14 +51,6 @@ (nth 2) (nth 2)))))) -(deftest checkbox-is-overridable - (binding [*checkbox-widget-theme* (fn [& _] \a)] - (is (= \a - (-> (render-widgets {:fields {:foo {:widget :checkbox}}} - {} {}) - (nth 2) - (nth 2)))))) - (deftest textarea-is-overridable (binding [*textarea-widget-theme* (fn [& _] \a)] (is (= \a