Skip to content
Snippets Groups Projects
Unverified Commit 29af7704 authored by Howon Lee's avatar Howon Lee Committed by GitHub
Browse files

Backwards compatibility for friendly field names (#16860)

We defriendlified but the migration running in the first place is not happening for some users. Investigating but it's better just to be safe on this front
parent 297fb1b4
Branches
Tags
No related merge requests found
......@@ -54,6 +54,11 @@
:when (not (str/blank? part))]
(capitalize-word part))))))
;; actual advanced method has been excised. this one just calls out to simple
(defmethod name->human-readable-name :advanced
([s] (name->human-readable-name :simple s))
([_, ^String s] (name->human-readable-name :simple s)))
;; :none is just an identity implementation
(defmethod name->human-readable-name :none
([s] s)
......
......@@ -34,7 +34,11 @@
"usersocialauth" "Usersocialauth"}]
(testing (pr-str (list 'name->human-readable-name :simple input))
(is (= expected
(humanization/name->human-readable-name :simple input))))))
(humanization/name->human-readable-name :simple input))))
;; there used to be an advanced mode but it should just act as simple mode now
(testing (pr-str (list 'name->human-readable-name :advanced input))
(is (= expected
(humanization/name->human-readable-name :advanced input))))))
(deftest none-humanization-test
(doseq [input [nil
......@@ -91,8 +95,10 @@
(deftest humanized-display-name-test
(testing "check that we get the expected :display_name with humanization *enabled*"
(doseq [[input strategy->expected] {"toucansare_cool" {"simple" "Toucansare Cool"
"advanced" "Toucansare Cool"
"none" "toucansare_cool"}
"fussybird_sightings" {"simple" "Fussybird Sightings"
"advanced" "Fussybird Sightings"
"none" "fussybird_sightings"}}
[strategy expected] strategy->expected]
(testing (pr-str (list 'get-humanized-display-name input strategy))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment